Thann / nodemon

Auto-restart node apps!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nodemon

Auto-restart node apps! (simpler alternative to the original nodemon)

npm install thann/nodemon

if (require('nodemon')()) return;

And your app will restart on any changes to the folder it's in!

This is just a wrapper for chokidar.watch(...), so you can pass any of those options.

CLI

You can also run arbitrary commands in the terminal like this:

$ nodemon echo cool

Advanced

const watcher = require('nodemon')(
  __dirname, // folder to watch
  {          // chokidar options
    ignored: /.*\/node_modules\/.*/
  },
  {          // library options
    killSignal: 'SIGTERM'
  }
);
if (watcher) {
  watcher.on('change', f => console.log('----- changed:', f));
  return;
}

See test.js for an example app.

About

Auto-restart node apps!

License:The Unlicense


Languages

Language:JavaScript 100.0%