상세 컨텐츠

본문 제목

[Node.js]서버 실행 모듈 - supervisor

WEB & Mobile

by mobile 2015. 5. 8. 14:36

본문

반응형

■ supervisor

파일의 변경을 자동으로 인식하고 종료후에 실행


- 사이트

https://github.com/isaacs/node-supervisor


- npm을 통한 설치

// 일반

npm install supervisor


// 전역

npm install -g 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] <program>

  supervisor [options] -- <program> [args ...]


Required:

  <program>

    The program to run.


Options:

  -w|--watch <watchItems>

    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 <ignoreItems>

    A comma-delimited list of folders to ignore for changes.

    No default


  -p|--poll-interval <milliseconds>

    How often to poll watched files for changes.

    Defaults to Node default.


  -e|--extensions <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 <executable>

    The executable that runs the specified program.

    Default is 'node'


  --debug

    Start node with --debug flag.


  --debug-brk

    Start node with --debug-brk flag.


  --harmony

    Start node with --harmony flag.


  -n|--no-restart-on error|exit

    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.


  --force-watch

    Use fs.watch instead of fs.watchFile.

    This may be useful if you see a high cpu load on a windows machine.


  -h|--help|-?

    Display these usage instructions.


  -q|--quiet

    Suppress DEBUG messages


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 port



반응형

'WEB & Mobile' 카테고리의 다른 글

[Node.js]외부 실행 모듈 - mysql  (0) 2015.05.08
[Node.js]서버 실행 모듈 - forever  (0) 2015.05.08
[HTML5]스프라이트 이미지  (0) 2015.05.01
[HTML5]뷰포트 meta 태그  (0) 2015.05.01
[CSS]CSS 초기화 코드  (0) 2015.04.30

관련글 더보기

댓글 영역