Lightweight HTTP server for local file sharing across your network with QR code access, upload/download capabilities, and smart network detection
npm install kn-lan-sharebash
Install globally
npm install -g kn-lan-share
Start the server
kls
`
That's it! Your file server is now running and accessible from any device on your local network.
📋 Table of Contents
- Installation
- Usage
- Command-Line Options
- Security Considerations
- Examples
- Development
- License
📦 Installation
$3
`bash
npm install -g kn-lan-share
`
$3
`bash
Clone the repository
git clone
cd kn-lan-share
Install dependencies
npm install
Build the project
npm run build
Run the server
npm start
`
🎯 Usage
$3
`bash
Start server on default port (3000)
kls
The server will display:
- Server host address
- Active network interface IP
- Access URL for other devices
`
$3
`bash
kls -p 8080
`
$3
`bash
kls -a 192.168.1.100
`
$3
`bash
kls -up
`
$3
`bash
kls -qr
`
$3
`bash
kls -p 8080 -up true -qr
`
🎛️ Command-Line Options
| Flag | Description | Default | Example |
| -------------- | --------------------------------------------------- | ------- | ---------------------- |
| -p | Custom port number | 3000 | kls -p 8080 |
| -a | Bind to specific IP address | 0.0.0.0 | kls -a 192.168.1.100 |
| -hw | High water mark for streams (1 to 1073741824 bytes) | Default | kls -hw 65536 |
| -qr | Display QR code in terminal | false | kls -qr |
| -up | Enable/disable file uploads | false | kls -up true |
🔒 Security Considerations
$3
By default, file uploads are disabled to protect your system from unauthorized file writes. To enable uploads:
`bash
kls -up
`
$3
The server binds to 0.0.0.0 by default, making it accessible from any device on your network. To restrict access:
`bash
Bind to localhost only
kls -a 127.0.0.1
Bind to specific network interface
kls -a 192.168.1.100
`
$3
- Only enable uploads (-up true) when you need to receive files
- Use on trusted networks only
- Monitor the terminal for access logs
- Stop the server when not in use
📖 Examples
$3
`bash
Start server with QR code for easy mobile access
kls -qr
`
Scan the QR code with your phone to instantly access files!
$3
`bash
Start on custom port with uploads enabled
kls -p 3000 -up
`
Share the URL with your team to both download and upload files.
$3
`bash
Start with custom buffer size for large file transfers
kls -hw 131072
`
Adjust the high water mark for optimal performance with large files.
$3
`bash
Bind to localhost only for local testing
kls -a 127.0.0.1 -p 3000
`
🤝 Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
📄 License
ISC License - See LICENSE file for details
👨💻 Author
knkrn5
🙏 Acknowledgments
- Built with Node.js native modules for zero-dependency runtime
- Uses qrcode-terminal` for QR code generation