Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petruisfan/node-supervisor
https://github.com/petruisfan/node-supervisor
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/petruisfan/node-supervisor
- Owner: petruisfan
- License: other
- Created: 2010-02-07T08:34:38.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2019-09-13T10:28:56.000Z (about 5 years ago)
- Last Synced: 2024-10-01T22:04:44.118Z (about 1 month ago)
- Language: JavaScript
- Size: 162 KB
- Stars: 3,757
- Watchers: 67
- Forks: 260
- Open Issues: 53
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nodejs-cn - supervisor - 当脚本崩溃时或者当```*.js``` 文件更改时重新启动脚本 (包 / 进程管理)
- awesome-nodejs - supervisor - Restart scripts when they crash or restart when a `*.js` file changes. ![](https://img.shields.io/github/stars/petruisfan/node-supervisor.svg?style=social&label=Star) (Repository / Process management)
- awesome-nodejs-cn - supervisor - **star:3766** 当脚本崩溃或' *时重新启动脚本js文件的更改 ![star > 2000][Awesome] (包 / 流程管理)
- awesome-github-star - node-supervisor
- awesome-nodejs - supervisor - Restart scripts when they crash or restart when a `*.js` file changes. (Packages / Process management)
- awesome-npm - supervisor - 支持热加载和自动重启,较消耗内存 (1. 后端开发 / 1.6 项目管理)
- awesome-nodejs - node-supervisor - ★ 3490 (Process management)
- awesome-node - supervisor - Restart scripts when they crash or restart when a `*.js` file changes. (Packages / Process management)
- awesome-nodejs-cn - supervisor - 当脚本崩溃时重新启动脚本,或者当`*.js'文件更改时重新启动脚本s. (目录 / 进程管理)
- awesome-nodejs - supervisor - 监听文件变化并自动重启 (Uncategorized / Uncategorized)
README
# node-supervisor
A little supervisor script for nodejs. It runs your program, and
watches for code changes, so you can have hot-code reloading-ish
behavior, without worrying about memory leaks and making sure you
clean up all the inter-module references, and without a whole new
`require` system.## node-supervisor -?
Node Supervisor is used to restart programs when they crash.
It can also be used to restart programs when a *.js file changes.Usage:
supervisor [options]
supervisor [options] -- [args ...]Required:
The program to run.Options:
-w|--watch
A comma-delimited list of folders or js files to watch for changes.
When a change to a js file occurs, reload the program
Default is '.'-i|--ignore
A comma-delimited list of folders to ignore for changes.
No default--ignore-symlinks
Ignore symlinks :)
-s|--timestamp
Log timestamp after each run.
Make it easy to tell when the task last ran.
-p|--poll-interval
How often to poll watched files for changes.
Defaults to Node default.-e|--extensions
A comma-delimited list of file extensions to watch for changes.
Default is 'node,js' (or when CoffeeScript, 'node,js,coffee,litcoffee').-x|--exec
The executable that runs the specified program.
Default is 'node'-pid|--save-pid
Save supervisor's process id to a file at the given path.--debug[=port]
Start node with --debug flag.--debug-brk[=port]
Start node with --debug-brk flag.--harmony
Start node with --harmony flag.--inspect[=port]
Start node with --inspect flag.-n|--no-restart-on error|exit|success
Don't automatically restart the supervised program if it ends.
Supervisor will wait for a change in the source files.
If "error", an exit code of 0 will still restart.
If "exit", no restart regardless of exit code.
If "success", no restart only if exit code is 0.-t|--non-interactive
Dissable interactive capacity
With this option, supervisor won't listen to stdin--force-watch
Use fs.watch instead of fs.watchFile.
This may be useful if you see a high cpu load on a windows machine.-k|--instant-kill
Instantly kills the server process, instead of gracefully shutting down the server.
This can be useful when the node app has events attached to SIGTERM or SIGINT so as to do a graceful shutdown before the process exits.
-RV|--restart-verbose
Logs the file(s) that caused supervisor to restart-h|--help|-?
Display these usage instructions.-q|--quiet
Suppress DEBUG messagesOptions available after start:
rs - restart process. Useful when you want to restart your program even
if no file has changed.Examples:
supervisor myapp.js
supervisor myapp.coffee
supervisor -w scripts -e myext -x myrunner myapp
supervisor -w lib,server.js,config.js server.js
supervisor -- server.js -h host -p portIn order to not watch for file changes, use "-i .".
## Simple Install
Just run:
npm install supervisor -g
## Fancy Install
Get this code, and then do this:
npm link