DEV Community

Haikel Fazzani
Haikel Fazzani

Posted on

Node Reload

↻ ♾️ NodeRel
NodeRel is a tool that automatically restarting the node application when file changes.

downloads version

  • Fast and simple to use.
  • Automatic re-running.
  • Manual restarting.
  • Monitoring multiple directories.
  • Ignoring files.
  • Delaying restarting.

Installation

npm install -g noderel 
# yarn global add noderel
Enter fullscreen mode Exit fullscreen mode

CLI

# all configs are optional 
noderel --entry bin/server.js --watch routes,app --delay 150 --verbose=false --allow-restart=true

# short
nnoderel -e tests/server.js -w routes,app -d 150 -v -r
Enter fullscreen mode Exit fullscreen mode

API

const noderel = require('noderel');

noderel(configuration?: Object): void
Enter fullscreen mode Exit fullscreen mode

Configuration

Prop Default Description
entry (package.json).main Set entry file
watch . Set the watch directories or files.
ignore `/node_modules\ (^\
delay {% raw %}100 Realod time between changes (ms).
verbose true Show logs
allow-restart true allow restart when typing rs

Config file

// noderel.json
// A config file can take any of the command line arguments as JSON key values, for example:
{
  "entry": "tests/server.js",
  "watch": ["src", "bin"],
  "ignore": "**/{node_modules,tests,dist,temp,.git}/*",
  "delay": 150,
  "verbose": true,
  "allowRestart": true // allow restart when typing `rs`
}
Enter fullscreen mode Exit fullscreen mode

Capture

Capture

License

MIT

Top comments (0)