Watch files/dirs, trigger actions. Like
entrbut with config files and queuing.
npm install -g @arc2898/watchdog# Watch a directory and run a command on changes
watchdog ./src --command "npm run build"
# Watch specific file types
watchdog ./src --pattern "*.ts" --command "npm run build"
# Run without queueing (parallel)
watchdog ./src --command "npm test" --no-queue
# Use {file} placeholder for the changed path
watchdog ./src --command "eslint {file}"-c, --command <cmd>— Command to run (required)-p, --pattern <glob>— File pattern (default:**/*)-d, --delay <ms>— Debounce delay (default: 500ms)-q, --queue— Queue commands instead of parallel (default: true)-v, --verbose— Verbose output (default: true)
Create watchdog.config.json:
{
"watch": "./src",
"pattern": "*.ts",
"command": "npm run build",
"delay": 300,
"queue": true
}Then run: watchdog --config watchdog.config.json
MIT