ghori
v0.1.2
Published
Restart your Node server on file save — nodemon-like dev CLI
Downloads
428
Maintainers
Readme
ghori
Restart your Node.js app automatically when you save a file (Ctrl+S).
Repository: github.com/ShameerMukhtar/ghori
npm: npmjs.com/package/ghori
Install
npm install --save-dev ghoriUsage
npm script (recommended)
{
"scripts": {
"dev": "ghori index.js"
}
}npm run devSave any watched file (Ctrl+S) — the server restarts automatically.
Direct command (local project)
npx ghori index.jsExamples
1. Default file — runs index.js if you omit the filename:
npx ghori2. Common entry files:
npx ghori index.js
npx ghori server.js
npx ghori app.js3. Nested entry (e.g. api/index.js):
npx ghori api/index.js4. Watch only src folder:
npx ghori -w src index.js5. Watch specific file types:
npx ghori -w src --ext js,json index.js6. TypeScript with tsx:
npx ghori -e tsx src/index.ts7. Slower restart (500ms debounce):
npx ghori -d 500 index.js8. npm scripts (use in package.json — works with npm run):
{
"scripts": {
"dev": "ghori index.js",
"dev:api": "ghori api/index.js"
}
}npm run dev
npm run dev:apiGlobal install (optional)
For ghori without npx, install globally:
npm install -g ghori
ghori index.jsManual restart
Type rs and press Enter.
Config
Create ghori.json in your project root:
{
"watch": ["src"],
"ignore": ["**/logs/**"],
"delay": 400,
"ext": "js,ts,json"
}Or in package.json:
{
"ghori": {
"watch": ["src"],
"delay": 400
}
}Options
| Flag | Description |
|------|-------------|
| [script] | Entry file (default: index.js) |
| -w, --watch | Paths to watch (default: .) |
| -i, --ignore | Glob patterns to ignore |
| -d, --delay | Debounce in ms (default: 300) |
| -e, --exec | Executable (default: node) |
| --ext | Extensions to watch (default: js,mjs,cjs,json,ts,tsx) |
Programmatic API
const { restarter } = require('ghori');
const app = restarter({ script: 'index.js', watch: ['src'] });
app.start();License
MIT
