tiny-lr-fork is an actively maintained fork of the original `tiny-lr` package, which had become unmaintained. It provides a lightweight, background-friendly LiveReload server implementation for development workflows. Unlike the original, this fork addresses lingering issues, incorporates community contributions, and includes security patches. Key differentiators include quieter operation (reduced `console.log` output), proper handling of WSS for `livereload.js` over HTTPS, and normalized Windows file paths. The server exposes a simple HTTP/WebSocket API that build tools (like Grunt, or custom scripts) can use to notify connected LiveReload clients (browser extensions or injected scripts) about file changes. It does not perform file watching itself, requiring external integration for detecting changes. The current stable version, as per the changelog, is 2.0.0, with a release cadence driven by bug fixes and necessary updates rather than a fixed schedule.
npm install tiny-lr-forkVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up `tiny-lr-fork` as a standalone LiveReload server integrated with an Express application, listening on the default port 35729. It shows both starting the server and integrating its middleware for handling reload requests, along with an example of a custom route. It also includes `curl` commands to trigger reloads.
Upgrade client-side browser versions or ensure your development setup does not require LiveReload functionality for IE6-9.
Ensure `app.use(express.json());` and `app.use(express.urlencoded({ extended: true }));` (or equivalent parsing middleware) are registered *before* `app.use(tinylr.middleware({ app: app }));`.For seamless browser extension integration, run `tiny-lr-fork` on port 35729. If a different port is necessary, manually edit the LiveReload browser extension's settings or use the manual script tag injection method with a `port` attribute in your HTML: `<script src="http://localhost:YOUR_PORT/livereload.js?snipver=1"></script>`.
Integrate with a file watcher in your build process. Upon file change detection, send an HTTP request to `http://localhost:35729/changed?files=your_file.css` or a POST request with a JSON payload to the `/changed` endpoint.
Always upgrade to the latest stable version of `tiny-lr-fork` to ensure all known security vulnerabilities in its dependencies are addressed. Current stable is >=2.0.0.
Stop the conflicting process, or configure `tiny-lr-fork` to listen on a different port using the `-p` or `--port` command line option, or by passing a `port` option to `tinylr().listen(port, ...)`.
Ensure your `tiny-lr-fork` server is running. If using it as middleware, verify `app.use(lrserver.middleware({ app: app }));` is correctly placed in your Connect/Express application and the `app` object is the same as the one listening on the port.For modern Express (4.x+), use `app.use(express.json());` and `app.use(express.urlencoded({ extended: true }));` to handle body and query parsing before the `tiny-lr-fork` middleware.