{"id":15356,"library":"mini-lr","title":"Mini LiveReload Server","description":"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`.","status":"deprecated","version":"0.1.9","language":"javascript","source_language":"en","source_url":"git://github.com/elwayman02/mini-lr","tags":["javascript"],"install":[{"cmd":"npm install mini-lr","lang":"bash","label":"npm"},{"cmd":"yarn add mini-lr","lang":"bash","label":"yarn"},{"cmd":"pnpm add mini-lr","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for the `mini-lr` middleware to parse POST request bodies, especially for bulk file change notifications.","package":"body-parser","optional":false},{"reason":"Internal dependency, patched in 0.1.9 for a vulnerability fix.","package":"debug","optional":false}],"imports":[{"note":"Primarily designed for CommonJS; direct ESM import might require a wrapper or bundler due to its older architecture.","wrong":"import minilr from 'mini-lr';","symbol":"minilr","correct":"const minilr = require('mini-lr');"},{"note":"The `minilr()` function is a factory for `new minilr.Server()`. Accessing `Server` directly allows more explicit instantiation.","wrong":"const Server = require('mini-lr').Server;","symbol":"Server","correct":"const { Server } = require('mini-lr');"},{"note":"The middleware function is a property of the main `minilr` export, not a top-level named export. Use CommonJS `require`.","wrong":"import { middleware } from 'mini-lr';","symbol":"middleware","correct":"const minilr = require('mini-lr');\nconst lrMiddleware = minilr.middleware;"}],"quickstart":{"code":"const path = require('path');\nconst express = require('express');\nconst minilr = require('mini-lr');\nconst body = require('body-parser');\n\nconst port = process.env.LR_PORT || process.env.PORT || 35729;\n\nconst app = express();\n\napp\n  .use(body.urlencoded({ extended: true }))\n  .use(body.json())\n  .use(minilr.middleware({ app: app }))\n  .use(express.static(path.resolve('./')))\n  .listen(port, function() {\n    console.log(`LiveReload server listening on port ${port}`);\n    console.log('To trigger a reload, run: curl http://localhost:35729/changed?files=index.html');\n  });","lang":"javascript","description":"Demonstrates setting up a mini-lr server as Express middleware, serving static files and listening for LiveReload notifications."},"warnings":[{"fix":"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.","message":"The `mini-lr` package is officially deprecated by its author. Users are strongly advised to migrate back to the `tiny-lr` package, which is now actively maintained and has added contributors. Continued use of `mini-lr` is not recommended for new projects or ongoing development.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"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`.","message":"When `mini-lr` was originally forked, it was to provide `npm v3` support and address `tiny-lr`'s inactivity. While `mini-lr` itself aimed for compatibility, switching between `tiny-lr` versions or forks might have required manual updates to dependencies or `require` paths, especially if projects were locked into older `tiny-lr` versions.","severity":"breaking","affected_versions":"<0.1.7"},{"fix":"Upgrade to `mini-lr@0.1.9` if you absolutely must continue using this deprecated package, or preferably, migrate to `tiny-lr`.","message":"A debug module vulnerability was patched in version `0.1.9`. While this was a patch version to address a security concern in an internal dependency, it underscores the importance of staying updated or migrating to the recommended, actively maintained `tiny-lr`.","severity":"gotcha","affected_versions":"<0.1.9"},{"fix":"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.","message":"The LiveReload browser extension typically expects the server to run on port `35729`. Using a different port will prevent the browser extension from connecting automatically. If you choose a custom port, you must manually include the LiveReload script tag in your HTML and specify the custom port.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Run `npm install mini-lr` or `yarn add mini-lr` to install the package. Ensure your `require('mini-lr')` statement is correct.","cause":"The package is not installed or the `require` path is incorrect.","error":"Error: Cannot find module 'mini-lr'"},{"fix":"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 })`.","cause":"`mini-lr.middleware` expects an Express/Connect `app` instance with `use` method when used with the `{ app: app }` option.","error":"TypeError: app.use is not a function"},{"fix":"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).","cause":"`mini-lr`'s middleware integration relies on `body-parser`. Old versions of `body-parser` or incorrect usage might trigger deprecation warnings.","error":"Error: body-parser deprecated undefined extended: provide extended option node_modules/mini-lr/index.js:77:21"}],"ecosystem":"npm"}