{"_id":"@benryoung/lan-clipboard","_rev":"2-fae2ff47a72b4545050a972e1a4a2251","name":"@benryoung/lan-clipboard","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@benryoung/lan-clipboard","version":"0.1.0","keywords":["clipboard","lan","file-sharing","pm2","cli"],"license":"MIT","_id":"@benryoung/lan-clipboard@0.1.0","maintainers":[{"name":"benryoung","email":"seikegn_yang@163.com"}],"homepage":"https://github.com/BenRYoung/LAN-clipboard#readme","bugs":{"url":"https://github.com/BenRYoung/LAN-clipboard/issues"},"bin":{"lcb":"bin/lcb.js"},"dist":{"shasum":"4dde6b21b267009d1216f4f3a3332d1874360ee1","tarball":"https://registry.npmjs.org/@benryoung/lan-clipboard/-/lan-clipboard-0.1.0.tgz","fileCount":12,"integrity":"sha512-ERzvsPVz+dSaGsp+SblXUaudBYkY8KCI6TBHp/zKuu4MzZ9IRXGbWEH3zyhzx3bXPES0G+tafcVM20I+uoFsTg==","signatures":[{"sig":"MEYCIQDDx5OVmYb9+cxffywyjM5FMikU2DZziUdBqL4cqmXuLAIhAI32PGdq/OJ60ShI4utOhekEPccbyVyRlrMoS1GobrMJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71473},"main":"app.js","engines":{"node":">=18"},"gitHead":"6f11d0ad831b92a0d391d786cebcb36ecf00dccf","scripts":{"test":"npm run check && npm run smoke && npm run test:lcb","check":"node -c app.js","smoke":"node tests/smoke_test.js","start":"node app.js","pm2:logs":"lcb service logs","pm2:stop":"lcb service stop","test:lcb":"node tests/cli_smoke_test.js","pm2:start":"lcb service start","pack:check":"npm pack --dry-run","pm2:status":"lcb service status","pm2:restart":"lcb service restart"},"_npmUser":{"name":"benryoung","email":"seikegn_yang@163.com"},"repository":{"url":"git+ssh://git@github.com/BenRYoung/LAN-clipboard.git","type":"git"},"_npmVersion":"11.9.0","description":"LAN clipboard and file sharing service with the lcb CLI.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"pm2":"^6.0.14","multer":"^2.1.1","express":"^4.18.2","socket.io":"^4.8.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/lan-clipboard_0.1.0_1779773894760_0.7949600852297731","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@benryoung/lan-clipboard","version":"0.1.1","description":"LAN clipboard and file sharing service with the lcb CLI.","main":"app.js","license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/BenRYoung/LAN-clipboard.git"},"bugs":{"url":"https://github.com/BenRYoung/LAN-clipboard/issues"},"homepage":"https://github.com/BenRYoung/LAN-clipboard#readme","publishConfig":{"access":"public"},"bin":{"lcb":"bin/lcb.js"},"scripts":{"start":"node app.js","test":"npm run check && npm run smoke && npm run test:upload-dir-sync && npm run test:package-removal && npm run test:lcb","check":"node -c app.js","smoke":"node tests/smoke_test.js","test:upload-dir-sync":"node tests/upload_dir_sync_test.js","test:package-removal":"node tests/package_removal_watcher_test.js","test:lcb":"node tests/cli_smoke_test.js","pack:check":"npm pack --dry-run","pm2:start":"lcb service start","pm2:stop":"lcb service stop","pm2:restart":"lcb service restart","pm2:status":"lcb service status","pm2:logs":"lcb service logs"},"keywords":["clipboard","lan","file-sharing","pm2","cli"],"engines":{"node":">=18"},"dependencies":{"express":"^4.18.2","multer":"^2.1.1","pm2":"^6.0.14","socket.io":"^4.8.3"},"gitHead":"d907f355ea187725913f6488b59668b9a769fc06","_id":"@benryoung/lan-clipboard@0.1.1","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-+lYuS2/j5nNuz+1VroV+88nYG90DwRiGPkdPcV8y9nUy73b+Q5MiTZY9ePdEIxRC/Da9kX86DKP3qs3mvl6aJA==","shasum":"c8825139d330c01ce313e1a9758dca7df098f141","tarball":"https://registry.npmjs.org/@benryoung/lan-clipboard/-/lan-clipboard-0.1.1.tgz","fileCount":13,"unpackedSize":1029389,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHxB50WS3CDSciDAagkgh9u1Qj55Z4OMqVtEC5gTg623AiEArGobslsHSdJLF/1FgFBJTivySUq593cS/NLXUpleyqY="}]},"_npmUser":{"name":"benryoung","email":"seikegn_yang@163.com"},"directories":{},"maintainers":[{"name":"benryoung","email":"seikegn_yang@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lan-clipboard_0.1.1_1779786169010_0.053517292506574554"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-26T05:38:14.650Z","modified":"2026-05-26T09:02:49.400Z","0.1.0":"2026-05-26T05:38:14.936Z","0.1.1":"2026-05-26T09:02:49.302Z"},"bugs":{"url":"https://github.com/BenRYoung/LAN-clipboard/issues"},"license":"MIT","homepage":"https://github.com/BenRYoung/LAN-clipboard#readme","keywords":["clipboard","lan","file-sharing","pm2","cli"],"repository":{"type":"git","url":"git+ssh://git@github.com/BenRYoung/LAN-clipboard.git"},"description":"LAN clipboard and file sharing service with the lcb CLI.","maintainers":[{"name":"benryoung","email":"seikegn_yang@163.com"}],"readme":"# LAN-clipboard\n\n[中文说明](README_zh.md)\n\nLAN-clipboard is a self-hosted local-network clipboard and file sharing service. It provides a browser-based shared workspace for text, screenshots, and files, plus the `lcb` command-line tool for configuration and PM2-backed service management.\n\nThe npm package name is `@benryoung/lan-clipboard`, and the CLI command is `lcb`.\n\n![LAN-clipboard initial UI](assets/screenshots/init_UI.png)\n\n## Features\n\n- Real-time text synchronization across devices on the same network.\n- Paste images/files or drag files into the browser UI and store them in the server upload directory.\n- Automatically show files that the server places directly in the upload directory.\n- Image preview and file download from the shared file grid.\n- Configurable upload directory, log directory, port, storage quota, and upload limit.\n- Storage usage API and orphan-file cleanup.\n- User-level configuration instead of hardcoded project paths.\n- PM2 service lifecycle commands through the bundled CLI.\n\n## Install\n\n```bash\nnpm install -g @benryoung/lan-clipboard\n```\n\nFor local development from this repository:\n\n```bash\nnpm install\nnpm link\n```\n\n## Configure And Start\n\nCreate the default configuration:\n\n```bash\nlcb config init\n```\n\n`config init` writes a user-level configuration file, creates runtime directories, and writes the PM2 service configuration. In an interactive terminal it asks whether to start the service immediately.\n\nCommon non-interactive setup:\n\n```bash\nlcb config init --yes --port 8765\nlcb service start\nlcb service status\n```\n\nThen open:\n\n```text\nhttp://localhost:8765\nhttp://<server-ip>:8765\n```\n\n## Uninstall\n\n```bash\nnpm uninstall -g @benryoung/lan-clipboard\n```\n\nA running `lcb` service watches its package installation directory. After global uninstall removes the package files, the service exits with code `0`; the PM2 configuration treats that exit code as a normal stop so the removed service is not restarted.\n\n## CLI Reference\n\n```bash\nlcb help\nlcb --help\nlcb --version\nlcb doctor\nlcb config path\nlcb config get\nlcb config set --port 8765 --uploads-dir ~/.local/share/lan-clipboard/uploads\nlcb service start\nlcb service status\nlcb service status --json\nlcb service logs --lines 20\nlcb service restart\nlcb service stop\n```\n\n## Configuration\n\nDefault config path:\n\n```text\n~/.config/lan-clipboard/config.json\n```\n\nDefault runtime directories:\n\n```text\nUploads: ~/.local/share/lan-clipboard/uploads\nLogs:    ~/.local/state/lan-clipboard/logs\n```\n\nOverride the config path:\n\n```bash\nLCB_CONFIG=/path/to/config.json lcb service start\nlcb service start --config /path/to/config.json\n```\n\nUseful configurable defaults:\n\n```text\nHost:                 0.0.0.0\nPort:                 8765\nUpload limit:         10 GB\nStorage limit:        30 GB\nSocket.IO buffer:     200 MB\nCleanup interval:     1 hour\nPM2 service name:     lan-clipboard\nPM2 memory threshold: 2G\n```\n\n`0.0.0.0` is the bind address. `lcb config init` and `lcb service status`\nalso print the LAN access URL, such as `http://<server-ip>:8765`.\n\n## HTTP And Socket.IO Surface\n\n- `GET /` serves the browser UI.\n- `GET /storage-status` returns current storage usage and quota information.\n- `POST /upload` uploads a file through multipart form data.\n- `POST /cleanup` removes orphaned files that are no longer referenced by the current UI state.\n- The upload directory is scanned at startup and watched for additions, updates, and removals while the service is running.\n- Socket.IO events synchronize text, pasted files, upload-directory files, delete requests, settings, and storage updates.\n\n## Development\n\n```bash\nnpm install\nnpm test\nnpm run pack:check\n```\n\nThe test suite starts short-lived local servers on test ports and verifies the browser entry, storage API, upload/download flow, upload-directory sync, config commands, and foreground service mode.\n\n## Release Checks\n\nBefore publishing:\n\n```bash\nnpm test\nnpm pack --dry-run\nnpm publish --dry-run --access public\n```\n\nThe package uses `package.json.files` to keep the npm tarball limited to runtime files, public documentation, and referenced assets.\n\n## Security Notes\n\nLAN-clipboard is designed for trusted local networks. It does not implement authentication or end-to-end encryption. Do not expose it directly to the public internet without adding an access-control layer such as a VPN, reverse proxy authentication, or firewall rules.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}