mini-lr is a JavaScript package that provides a lightweight LiveReload server implementation. It was originally forked from the `tiny-lr` project to address perceived inactivity and provide support for `npm v3` during a period when `tiny-lr` was not being actively maintained. The package exposes an HTTP server and can be used as Express/Connect middleware, offering a basic REST API to notify the server of file changes, which are then broadcast to connected LiveReload clients. It does not include file watching capabilities itself, requiring external build processes or application logic to trigger change notifications. The current stable version is 0.1.9, though the project is explicitly deprecated, with its author recommending users switch back to the now-active `tiny-lr` package. Therefore, there is no active release cadence planned for `mini-lr`.
npm install mini-lrVerified import paths — ran on the pinned version, not inferred.
Demonstrates setting up a mini-lr server as Express middleware, serving static files and listening for LiveReload notifications.
Replace `mini-lr` with `tiny-lr` in your project's dependencies and update `require` statements accordingly. Refer to the `tiny-lr` documentation for correct usage.
Ensure `mini-lr` is at least `0.1.7` for `npm v3` compatibility. For current projects, the recommended fix is to migrate to the latest `tiny-lr`.
Upgrade to `mini-lr@0.1.9` if you absolutely must continue using this deprecated package, or preferably, migrate to `tiny-lr`.
Always run `mini-lr` on port `35729` if relying on the browser extension. If a different port is required, add `<script src="http://localhost:YOUR_PORT/livereload.js?snipver=1"></script>` to your HTML.
Run `npm install mini-lr` or `yarn add mini-lr` to install the package. Ensure your `require('mini-lr')` statement is correct.Ensure you are passing a valid Express or Connect application instance to the `middleware` function, as shown in the integration examples: `minilr.middleware({ app: app })`.Ensure `body-parser` is correctly configured before `mini-lr.middleware`. For Express, use `app.use(body.urlencoded({ extended: true }))` and `app.use(body.json())` with the `extended` option explicitly set to `true` or `false` (recommended `true` for general use, or `false` for simple key-value pairs).