dev-refresh

raw JSON →
1.2.1 verified Fri May 01 auth: no javascript

Dev-refresh is a CLI utility that watches directories for changes, runs a command (e.g., bundler or transpiler) on change, and automatically reloads the browser. If the command fails, the error message is displayed on the page, and the page is not reloaded. Current stable version: 1.2.1. Release cadence: low, with infrequent updates. It supports serving local files or proxying to an existing server. Differentiators: lightweight, no build step required, inline error display. Not for production use.

error Error: ENOENT: no such file or directory, stat '...'
cause The watched directory does not exist.
fix
Ensure the directory path provided to dev-refresh exists.
error Error: listen EADDRINUSE :::8080
cause Port 8080 is already in use by another process.
fix
Use the --port option to specify a different port.
gotcha The --cmd option runs in the shell, so ensure proper escaping of arguments.
fix Use single quotes for commands with spaces or special characters.
gotcha Dev-refresh is not intended for production use; it serves files with auto-reload, which can be a security risk.
fix Do not expose dev-refresh to the public internet.
npm install dev-refresh
yarn add dev-refresh
pnpm add dev-refresh

Watch current directory, serve its files on default port, run echo and ls on change, reload browser.

npx dev-refresh --serve . --cmd 'echo changed && ls' .