Commit project
This commit is contained in:
parent
28471965a0
commit
3ac017a5ad
1030 changed files with 94062 additions and 0 deletions
41
node_modules/nodemon/doc/arch.md
generated
vendored
Normal file
41
node_modules/nodemon/doc/arch.md
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
# nodemon code arch
|
||||
|
||||
```
|
||||
CLI -> parser -> nodemon options -> rules
|
||||
|
||||
rules -> configure -> watch -> start process
|
||||
```
|
||||
|
||||
## CLI examples
|
||||
|
||||
Watch src but only *.js and *.coffee
|
||||
|
||||
nodemon --watch src/ -e js,coffee app.js
|
||||
|
||||
Parsed to:
|
||||
|
||||
{
|
||||
watch: ['src/'],
|
||||
ignore: [],
|
||||
script: 'app.js'
|
||||
options: {
|
||||
extensions: ['js', 'coffee'],
|
||||
exec: 'node'
|
||||
}
|
||||
}
|
||||
|
||||
Watch with no args:
|
||||
|
||||
nodemon
|
||||
|
||||
Parsed to (assuming a package.json or index.js is found):
|
||||
|
||||
{
|
||||
watch: [], // meaning all subdirectories
|
||||
ignore: [],
|
||||
script: 'index.js',
|
||||
options: {
|
||||
extensions: ['js'],
|
||||
exec: 'node'
|
||||
}
|
||||
}
|
8
node_modules/nodemon/doc/cli/authors.txt
generated
vendored
Normal file
8
node_modules/nodemon/doc/cli/authors.txt
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
Remy Sharp - author and maintainer
|
||||
http://github.com/remy
|
||||
http://twitter.com/rem
|
||||
|
||||
Contributors: https://github.com/remy/nodemon/graphs/contributors ❤︎
|
||||
|
||||
Please help make nodemon better: https://github.com/remy/nodemon/
|
44
node_modules/nodemon/doc/cli/config.txt
generated
vendored
Normal file
44
node_modules/nodemon/doc/cli/config.txt
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
|
||||
Typically the options to control nodemon are passed in via the CLI and are
|
||||
listed under the default nodemon --help command.
|
||||
|
||||
nodemon can also be configured via a local and global config file:
|
||||
|
||||
* $HOME/nodemon.json
|
||||
* $PWD/nodemon.json OR --config <file>
|
||||
* nodemonConfig in package.json
|
||||
|
||||
All config options in the .json file map 1-to-1 with the CLI options, so a
|
||||
config could read as:
|
||||
|
||||
{
|
||||
"ext": "*.pde",
|
||||
"verbose": true,
|
||||
"exec": "processing --sketch=game --run"
|
||||
}
|
||||
|
||||
There are a limited number of variables available in the config (since you
|
||||
could use backticks on the CLI to use a variable, backticks won't work in
|
||||
the .json config).
|
||||
|
||||
* {{pwd}} - the current directory
|
||||
* {{filename}} - the filename you pass to nodemon
|
||||
|
||||
For example:
|
||||
|
||||
{
|
||||
"ext": "*.pde",
|
||||
"verbose": true,
|
||||
"exec": "processing --sketch={{pwd}} --run"
|
||||
}
|
||||
|
||||
The global config file is useful for setting up default executables
|
||||
instead of repeating the same option in each of your local configs:
|
||||
|
||||
{
|
||||
"verbose": true,
|
||||
"execMap": {
|
||||
"rb": "ruby",
|
||||
"pde": "processing --sketch={{pwd}} --run"
|
||||
}
|
||||
}
|
41
node_modules/nodemon/doc/cli/help.txt
generated
vendored
Normal file
41
node_modules/nodemon/doc/cli/help.txt
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
Usage: nodemon [options] [script.js] [args]
|
||||
|
||||
Options:
|
||||
|
||||
--config file ............ alternate nodemon.json config file to use
|
||||
-e, --ext ................ extensions to look for, ie. js,jade,hbs.
|
||||
-x, --exec app ........... execute script with "app", ie. -x "python -v".
|
||||
-w, --watch dir........... watch directory "dir" or files. use once for
|
||||
each directory or file to watch.
|
||||
-i, --ignore ............. ignore specific files or directories.
|
||||
-q, --quiet .............. minimise nodemon messages to start/stop only.
|
||||
-V, --verbose ............ show detail on what is causing restarts.
|
||||
-I, --no-stdin ........... don't try to read from stdin.
|
||||
-C, --on-change-only ..... execute script on change only, not startup
|
||||
--no-colors .............. disable color output
|
||||
-d, --delay n ............ debounce restart for "n" seconds.
|
||||
--exitcrash .............. exit on crash, allows use of nodemon with daemon
|
||||
tools like forever.js.
|
||||
-v, --version ............ current nodemon version.
|
||||
-h, --help ............... you're looking at it.
|
||||
--help <topic> ........... help on a specific feature. Try "--help topics".
|
||||
-- <your args> ........... to tell nodemon stop slurping arguments.
|
||||
|
||||
Note: if the script is omitted, nodemon will try to read "main" from
|
||||
package.json and without a nodemon.json, nodemon will monitor .js, .coffee,
|
||||
and .litcoffee by default.
|
||||
|
||||
To learn more about nodemon.json config: nodemon --help config
|
||||
See also the sample: https://github.com/remy/nodemon/wiki/Sample-nodemon.json
|
||||
|
||||
Examples:
|
||||
|
||||
$ nodemon server.js
|
||||
$ nodemon --config my/custom/nodemon.json server.js
|
||||
$ nodemon -w ../foo server.js apparg1 apparg2
|
||||
$ PORT=8000 nodemon --debug-brk server.js
|
||||
$ nodemon --exec python app.py
|
||||
$ nodemon --exec "make build" -e "styl hbs"
|
||||
$ nodemon app.js -- -v
|
||||
|
||||
For more details see http://github.com/remy/nodemon/
|
20
node_modules/nodemon/doc/cli/logo.txt
generated
vendored
Normal file
20
node_modules/nodemon/doc/cli/logo.txt
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
; ;
|
||||
kO. x0
|
||||
KMX, .:x0kc. 'KMN
|
||||
0MMM0: 'oKMMMMMMMXd, ;OMMMX
|
||||
oMMMMMWKOONMMMMMMMMMMMMMWOOKWMMMMMx
|
||||
OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMK.
|
||||
.oWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd.
|
||||
KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
|
||||
KMMMMMMMMMMMMMMW0k0WMMMMMMMMMMMMMMW
|
||||
KMMMMMMMMMMMNk:. :xNMMMMMMMMMMMW
|
||||
KMMMMMMMMMMK OMMMMMMMMMMW
|
||||
KMMMMMMMMMMO xMMMMMMMMMMN
|
||||
KMMMMMMMMMMO xMMMMMMMMMMN
|
||||
KMMMMMMMMMMO xMMMMMMMMMMN
|
||||
KMMMMMMMMMMO xMMMMMMMMMMN
|
||||
KMMMMMMMMMMO xMMMMMMMMMMN
|
||||
KMMMMMMMMMNc ;NMMMMMMMMMN
|
||||
KMMMMMW0o' .lOWMMMMMN
|
||||
KMMKd; ,oKMMN
|
||||
kX: ,K0
|
6
node_modules/nodemon/doc/cli/topics.txt
generated
vendored
Normal file
6
node_modules/nodemon/doc/cli/topics.txt
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
config ................... default config options using nodemon.json
|
||||
authors .................. contributors to this project
|
||||
whoami ................... I, AM, NODEMON \o/
|
||||
|
||||
Please contribute http://github.com/remy/nodemon/
|
3
node_modules/nodemon/doc/cli/usage.txt
generated
vendored
Normal file
3
node_modules/nodemon/doc/cli/usage.txt
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
Usage: nodemon [nodemon options] [script.js] [args]
|
||||
|
||||
See "nodemon --help" for more.
|
9
node_modules/nodemon/doc/cli/whoami.txt
generated
vendored
Normal file
9
node_modules/nodemon/doc/cli/whoami.txt
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
__/\\\\\_____/\\\_______/\\\\\_______/\\\\\\\\\\\\_____/\\\\\\\\\\\\\\\__/\\\\____________/\\\\_______/\\\\\_______/\\\\\_____/\\\_
|
||||
_\/\\\\\\___\/\\\_____/\\\///\\\____\/\\\////////\\\__\/\\\///////////__\/\\\\\\________/\\\\\\_____/\\\///\\\____\/\\\\\\___\/\\\_
|
||||
_\/\\\/\\\__\/\\\___/\\\/__\///\\\__\/\\\______\//\\\_\/\\\_____________\/\\\//\\\____/\\\//\\\___/\\\/__\///\\\__\/\\\/\\\__\/\\\_
|
||||
_\/\\\//\\\_\/\\\__/\\\______\//\\\_\/\\\_______\/\\\_\/\\\\\\\\\\\_____\/\\\\///\\\/\\\/_\/\\\__/\\\______\//\\\_\/\\\//\\\_\/\\\_
|
||||
_\/\\\\//\\\\/\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/\\\///////______\/\\\__\///\\\/___\/\\\_\/\\\_______\/\\\_\/\\\\//\\\\/\\\_
|
||||
_\/\\\_\//\\\/\\\_\//\\\______/\\\__\/\\\_______\/\\\_\/\\\_____________\/\\\____\///_____\/\\\_\//\\\______/\\\__\/\\\_\//\\\/\\\_
|
||||
_\/\\\__\//\\\\\\__\///\\\__/\\\____\/\\\_______/\\\__\/\\\_____________\/\\\_____________\/\\\__\///\\\__/\\\____\/\\\__\//\\\\\\_
|
||||
_\/\\\___\//\\\\\____\///\\\\\/_____\/\\\\\\\\\\\\/___\/\\\\\\\\\\\\\\\_\/\\\_____________\/\\\____\///\\\\\/_____\/\\\___\//\\\\\_
|
||||
_\///_____\/////_______\/////_______\////////////_____\///////////////__\///______________\///_______\/////_______\///_____\/////__
|
79
node_modules/nodemon/doc/events.md
generated
vendored
Normal file
79
node_modules/nodemon/doc/events.md
generated
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
# Events
|
||||
|
||||
nodemon will emit events based on the child process.
|
||||
|
||||
## Commands
|
||||
|
||||
- restart
|
||||
- config:update
|
||||
- quit
|
||||
|
||||
## States
|
||||
|
||||
- start - child process has started
|
||||
- crash - child process has crashed (nodemon will not emit exit)
|
||||
- exit - child process has cleanly exited (ie. no crash)
|
||||
- restart([ array of files triggering the restart ]) - child process has restarted
|
||||
- config:update - nodemon's config has changed
|
||||
|
||||
## Messages
|
||||
|
||||
- log({ type, message (plain text log), colour (colour coded log) }) - logging from nodemon (not the child process)
|
||||
- stdout - the stdout stream from the child process
|
||||
- stderr - the stderr stream from the child process
|
||||
- readable - stdout and stderr streams are ready ([example](https://github.com/remy/nodemon#pipe-output-to-somewhere-else))
|
||||
|
||||
Note that if you want to supress the normal stdout & stderr of the child, in favour
|
||||
of processing the stream manually using the stdout/stderr nodemon events, pass
|
||||
nodemon the option of `stdout: false`.
|
||||
|
||||
## Using nodemon events
|
||||
|
||||
If nodemon is required, events can be bound and emitted on the nodemon object:
|
||||
|
||||
```js
|
||||
var nodemon = require('nodemon');
|
||||
|
||||
nodemon({ script: 'app.js' }).on('start', function () {
|
||||
console.log('nodemon started');
|
||||
}).on('crash', function () {
|
||||
console.log('script crashed for some reason');
|
||||
});
|
||||
|
||||
// force a restart
|
||||
nodemon.emit('restart');
|
||||
|
||||
// force a quit
|
||||
nodemon.emit('quit');
|
||||
```
|
||||
|
||||
If nodemon is a spawned process, then the child (nodemon) will emit message
|
||||
events whereby the event argument contains the event type, and instead of
|
||||
emitting events, you `send` the command:
|
||||
|
||||
```js
|
||||
var app = spawnNodemon();
|
||||
|
||||
app.on('message', function (event) {
|
||||
if (event.type === 'start') {
|
||||
console.log('nodemon started');
|
||||
} else if (event.type === 'crash') {
|
||||
console.log('script crashed for some reason');
|
||||
}
|
||||
});
|
||||
|
||||
// force a restart
|
||||
app.send('restart');
|
||||
|
||||
// force a quit
|
||||
app.send('quit');
|
||||
```
|
||||
|
||||
Note that even though the child will still emit a `message` event whose type is
|
||||
`exit`, it makes more sense to listen to the actual `exit` event on the child:
|
||||
|
||||
```js
|
||||
app.on('exit', function () {
|
||||
console.log('nodemon quit');
|
||||
});
|
||||
```
|
8
node_modules/nodemon/doc/option-parsing-logic.md
generated
vendored
Normal file
8
node_modules/nodemon/doc/option-parsing-logic.md
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Option parsing logic
|
||||
|
||||
1. Read all CLI arguments
|
||||
2. Load local config
|
||||
3. Load global config
|
||||
4. Try backup: package.main
|
||||
5. Try backup: package.start
|
||||
6. Try index.js
|
56
node_modules/nodemon/doc/requireable.md
generated
vendored
Normal file
56
node_modules/nodemon/doc/requireable.md
generated
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
# Nodemon as a required module
|
||||
|
||||
Nodemon (as of 1.0.0) also works as a required module. At present, you can only require nodemon in to your project once (as there are static config variables), but you can re-run with new settings for a different application to monitor.
|
||||
|
||||
By requiring nodemon, you can extend it's functionality. Below is a simple example of using nodemon in your project:
|
||||
|
||||
```js
|
||||
var nodemon = require('nodemon');
|
||||
|
||||
nodemon({
|
||||
script: 'app.js',
|
||||
ext: 'js json'
|
||||
});
|
||||
|
||||
nodemon.on('start', function () {
|
||||
console.log('App has started');
|
||||
}).on('quit', function () {
|
||||
console.log('App has quit');
|
||||
process.exit();
|
||||
}).on('restart', function (files) {
|
||||
console.log('App restarted due to: ', files);
|
||||
});
|
||||
```
|
||||
|
||||
Nodemon will emit a number of [events](https://github.com/remy/nodemon/blob/master/doc/events.md) by default, and when in verbose mode will also emit a `log` event (which matches what the nodemon cli tool echos).
|
||||
|
||||
## Arguments
|
||||
|
||||
The `nodemon` function takes either an object (that matches the [nodemon config](https://github.com/remy/nodemon#config-files)) or can take a string that matches the arguments that would be used on the command line:
|
||||
|
||||
```js
|
||||
var nodemon = require('nodemon');
|
||||
|
||||
nodemon('-e "js json" app.js');
|
||||
```
|
||||
|
||||
## Methods & Properties
|
||||
|
||||
The `nodemon` object also has a few methods and properties. Some are exposed to help with tests, but have been listed here for completeness:
|
||||
|
||||
### Event handling
|
||||
|
||||
This is simply the event emitter bus that exists inside nodemon exposed at the top level module (ie. it's the `events` api):
|
||||
|
||||
- `nodemon.on(event, fn)`
|
||||
- `nodemon.addListener(event, fn)`
|
||||
- `nodemon.once(event, fn)`
|
||||
- `nodemon.emit(event)`
|
||||
- `nodemon.removeAllListeners([event])`
|
||||
|
||||
Note: there's no `removeListener` (happy to take a pull request if it's needed).
|
||||
|
||||
### Test utilities
|
||||
|
||||
- `nodemon.reset()` - reverts nodemon's internal state to a clean slate
|
||||
- `nodemon.config` - a reference to the internal config nodemon uses
|
34
node_modules/nodemon/doc/rules.md
generated
vendored
Normal file
34
node_modules/nodemon/doc/rules.md
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Rules
|
||||
|
||||
Given a nodemon.json file that contains:
|
||||
|
||||
```json
|
||||
{
|
||||
"ignore": ["*.coffee"],
|
||||
"watch": ["server/*.coffee", "test/"]
|
||||
}
|
||||
```
|
||||
|
||||
Then nodemon detects changes, but what causes nodemon to restart? The ignored files or the watched files? Which wins?
|
||||
|
||||
```js
|
||||
var files = ['server/foo.coffee', 'server/app.js'];
|
||||
|
||||
// afterIgnore = ['server/app.js'] now since foo.coffee matches *.coffee
|
||||
var afterIgnore = files.filter(applyIgnore);
|
||||
|
||||
// watch = ['server/foo.coffee'] as it's under the watch
|
||||
var watched = files.filter(applyWatch);
|
||||
```
|
||||
|
||||
What about:
|
||||
|
||||
```js
|
||||
var files = ['test/app.js', 'test/app.coffee'];
|
||||
|
||||
// afterIgnore = ['test/app.js'] now since test/app.coffee matches *.coffee
|
||||
var afterIgnore = files.filter(applyIgnore);
|
||||
|
||||
// watch.length = 2 as watch implies test/*.*
|
||||
var watched = files.filter(applyWatch);
|
||||
```
|
28
node_modules/nodemon/doc/sample-nodemon.md
generated
vendored
Normal file
28
node_modules/nodemon/doc/sample-nodemon.md
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Sample nodemon.json
|
||||
|
||||
Here is an example (of a contrived) `nodemon.json` file:
|
||||
|
||||
{
|
||||
"restartable": "rs",
|
||||
"ignore": [
|
||||
".git",
|
||||
"node_modules/**/node_modules"
|
||||
],
|
||||
"verbose": true,
|
||||
"execMap": {
|
||||
"js": "node --harmony"
|
||||
},
|
||||
"events": {
|
||||
"restart": "osascript -e 'display notification \"App restarted due to:\n'$FILENAME'\" with title \"nodemon\"'"
|
||||
},
|
||||
"watch": [
|
||||
"test/fixtures/",
|
||||
"test/samples/"
|
||||
],
|
||||
"env": {
|
||||
"NODE_ENV": "development"
|
||||
},
|
||||
"ext": "js json"
|
||||
}
|
||||
|
||||
Note that the `ignore` used is nodemon's default ignore rule. The complete defaults can be seen here: [defaults.js](https://github.com/remy/nodemon/blob/master/lib/config/defaults.js).
|
Loading…
Add table
Add a link
Reference in a new issue