tiny-lr is a minimalist LiveReload server implementation designed for integration into build workflows. It provides an HTTP server and Express middleware with a simple REST API to broadcast file change notifications to connected LiveReload clients. Unlike comprehensive live-reloading solutions, tiny-lr does not include file watching capabilities itself; users must integrate it with an external file watcher (e.g., from a build tool like Gulp or Grunt). The current stable version is 2.0.0, which marked a return to active development after a period of dormancy, focusing on dependency updates and modern browser compatibility. Its primary differentiators are its focused scope (only serving reload notifications), ease of integration into existing build chains, and low overhead, making it suitable for projects that prefer to manage file watching separately.
npm install tiny-lrVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates setting up a tiny-lr server on its standard port and integrating its middleware with an Express application. It also shows how to programmatically trigger a file change notification to connected LiveReload clients.
Upgrade browser target to modern browsers (IE10+ or equivalent) or downgrade tiny-lr to a 1.x version if IE 6-9 support is critical, understanding that older versions may have known vulnerabilities.
Always configure the tiny-lr server to listen on port `35729` (e.g., `lrServer.listen(35729)`).
Ensure your build system or development workflow includes a file watcher that explicitly calls tiny-lr's `/changed` endpoint (via HTTP POST/GET or `lrServer.changed()`) when files are modified.
Add `app.use(bodyParser.json());` and/or `app.use(bodyParser.urlencoded({ extended: true }));` before `app.use(tinylr.middleware({ app: app }));`.Always use the latest stable version (2.0.0 or higher) of `tiny-lr` to benefit from recent dependency updates and bug fixes. Avoid using abandoned forks.
Ensure no other applications are running on port 35729. On Linux/macOS, use `lsof -i :35729` to identify and kill the process. On Windows, use `netstat -ano | findstr :35729` and then `taskkill /PID <PID> /F`.
When using `tinylr.middleware`, ensure you pass a valid Express/Connect application instance, e.g., `tinylr.middleware({ app: app })` where `app = express();`.Verify that `lrServer.listen()` is called and the server is running, or that `app.use(tinylr.middleware({ app: app }))` is in your Express app's middleware stack, preceded by `body-parser` if using POST requests. Check the port being targeted.Confirm tiny-lr is listening on port 35729. Check your browser's extension icon to ensure LiveReload is active for your page. Inspect browser console for `livereload.js` connection errors. Disable firewalls temporarily for testing.
No dependency data recorded yet.