supervisor script for node.js


supervisor sctipt for nodejs.

  • watch code changes
  • cluster
  • daemonize
  • colorize console
  • env setter

npm install -g nodectl

cd $HOME
express test
cd test
npm install
nodectl start app.js
nodectl -w app.js
nodectl -d app.js
nodectl -d -w app.js
cd ~/test
nodectl stop
cd ~/test
nodectl start -d app.js
nodectl reload
nodectl restart
nodectl status
  application running.

nodectl [action] [options] <program>

execute program (default action)

stop daemonized program

restart program with daemonize mode

force clear pid

release edited javascript (restart only child processes)

check program running or not

default 3000, pass listening port (process.env.PORT)

default development, pass environment (process.env.NODE_ENV)

default number of cpu threads, concurrent process with cluster module

pid file location

stop colorize console

daemonize process

watch code changes, auto reload programs

check options (not execute)

show version and exit

show help message and exit

  • [options] default from ${HOME}/.noserc.json
  • default from package.json: main

nodectl automatically search nearest package.json form parent directories.

  • application name from package.json: name
  • application version from package.json: version
  • application main script from package.json: main