Initial commit - Event Planner application

This commit is contained in:
mberlin
2026-03-18 14:55:56 -03:00
commit 86d779eb4d
7548 changed files with 1006324 additions and 0 deletions

21
node_modules/nodemon/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2010 - present, Remy Sharp, https://remysharp.com <remy@remysharp.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

434
node_modules/nodemon/README.md generated vendored Normal file
View File

@@ -0,0 +1,434 @@
<p align="center">
<a href="https://nodemon.io/"><img src="https://user-images.githubusercontent.com/13700/35731649-652807e8-080e-11e8-88fd-1b2f6d553b2d.png" alt="Nodemon Logo"></a>
</p>
# nodemon
nodemon is a tool that helps develop Node.js based applications by automatically restarting the node application when file changes in the directory are detected.
nodemon does **not** require *any* additional changes to your code or method of development. nodemon is a replacement wrapper for `node`. To use `nodemon`, replace the word `node` on the command line when executing your script.
[![NPM version](https://badge.fury.io/js/nodemon.svg)](https://npmjs.org/package/nodemon)
[![Travis Status](https://travis-ci.org/remy/nodemon.svg?branch=master)](https://travis-ci.org/remy/nodemon) [![Backers on Open Collective](https://opencollective.com/nodemon/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/nodemon/sponsors/badge.svg)](#sponsors)
# Installation
Either through cloning with git or by using [npm](http://npmjs.org) (the recommended way):
```bash
npm install -g nodemon # or using yarn: yarn global add nodemon
```
And nodemon will be installed globally to your system path.
You can also install nodemon as a development dependency:
```bash
npm install --save-dev nodemon # or using yarn: yarn add nodemon -D
```
With a local installation, nodemon will not be available in your system path or you can't use it directly from the command line. Instead, the local installation of nodemon can be run by calling it from within an npm script (such as `npm start`) or using `npx nodemon`.
# Usage
nodemon wraps your application, so you can pass all the arguments you would normally pass to your app:
```bash
nodemon [your node app]
```
For CLI options, use the `-h` (or `--help`) argument:
```bash
nodemon -h
```
Using nodemon is simple, if my application accepted a host and port as the arguments, I would start it as so:
```bash
nodemon ./server.js localhost 8080
```
Any output from this script is prefixed with `[nodemon]`, otherwise all output from your application, errors included, will be echoed out as expected.
You can also pass the `inspect` flag to node through the command line as you would normally:
```bash
nodemon --inspect ./server.js 80
```
If you have a `package.json` file for your app, you can omit the main script entirely and nodemon will read the `package.json` for the `main` property and use that value as the app ([ref](https://github.com/remy/nodemon/issues/14)).
nodemon will also search for the `scripts.start` property in `package.json` (as of nodemon 1.1.x).
Also check out the [FAQ](https://github.com/remy/nodemon/blob/master/faq.md) or [issues](https://github.com/remy/nodemon/issues) for nodemon.
## Automatic re-running
nodemon was originally written to restart hanging processes such as web servers, but now supports apps that cleanly exit. If your script exits cleanly, nodemon will continue to monitor the directory (or directories) and restart the script if there are any changes.
## Manual restarting
Whilst nodemon is running, if you need to manually restart your application, instead of stopping and restart nodemon, you can type `rs` with a carriage return, and nodemon will restart your process.
## Config files
nodemon supports local and global configuration files. These are usually named `nodemon.json` and can be located in the current working directory or in your home directory. An alternative local configuration file can be specified with the `--config <file>` option.
The specificity is as follows, so that a command line argument will always override the config file settings:
- command line arguments
- local config
- global config
A config file can take any of the command line arguments as JSON key values, for example:
```json
{
"verbose": true,
"ignore": ["*.test.js", "**/fixtures/**"],
"execMap": {
"rb": "ruby",
"pde": "processing --sketch={{pwd}} --run"
}
}
```
The above `nodemon.json` file might be my global config so that I have support for ruby files and processing files, and I can run `nodemon demo.pde` and nodemon will automatically know how to run the script even though out of the box support for processing scripts.
A further example of options can be seen in [sample-nodemon.md](https://github.com/remy/nodemon/blob/master/doc/sample-nodemon.md)
### package.json
If you want to keep all your package configurations in one place, nodemon supports using `package.json` for configuration.
Specify the config in the same format as you would for a config file but under `nodemonConfig` in the `package.json` file, for example, take the following `package.json`:
```json
{
"name": "nodemon",
"homepage": "http://nodemon.io",
"...": "... other standard package.json values",
"nodemonConfig": {
"ignore": ["**/test/**", "**/docs/**"],
"delay": 2500
}
}
```
Note that if you specify a `--config` file or provide a local `nodemon.json` any `package.json` config is ignored.
*This section needs better documentation, but for now you can also see `nodemon --help config` ([also here](https://github.com/remy/nodemon/blob/master/doc/cli/config.txt))*.
## Using nodemon as a module
Please see [doc/requireable.md](doc/requireable.md)
## Using nodemon as child process
Please see [doc/events.md](doc/events.md#Using_nodemon_as_child_process)
## Running non-node scripts
nodemon can also be used to execute and monitor other programs. nodemon will read the file extension of the script being run and monitor that extension instead of `.js` if there's no `nodemon.json`:
```bash
nodemon --exec "python -v" ./app.py
```
Now nodemon will run `app.py` with python in verbose mode (note that if you're not passing args to the exec program, you don't need the quotes), and look for new or modified files with the `.py` extension.
### Default executables
Using the `nodemon.json` config file, you can define your own default executables using the `execMap` property. This is particularly useful if you're working with a language that isn't supported by default by nodemon.
To add support for nodemon to know about the `.pl` extension (for Perl), the `nodemon.json` file would add:
```json
{
"execMap": {
"pl": "perl"
}
}
```
Now running the following, nodemon will know to use `perl` as the executable:
```bash
nodemon script.pl
```
It's generally recommended to use the global `nodemon.json` to add your own `execMap` options. However, if there's a common default that's missing, this can be merged in to the project so that nodemon supports it by default, by changing [default.js](https://github.com/remy/nodemon/blob/master/lib/config/defaults.js) and sending a pull request.
## Monitoring multiple directories
By default nodemon monitors the current working directory. If you want to take control of that option, use the `--watch` option to add specific paths:
```bash
nodemon --watch app --watch libs app/server.js
```
Now nodemon will only restart if there are changes in the `./app` or `./libs` directory. By default nodemon will traverse sub-directories, so there's no need in explicitly including sub-directories.
Nodemon also supports unix globbing, e.g `--watch './lib/*'`. The globbing pattern must be quoted.
## Specifying extension watch list
By default, nodemon looks for files with the `.js`, `.mjs`, `.coffee`, `.litcoffee`, and `.json` extensions. If you use the `--exec` option and monitor `app.py` nodemon will monitor files with the extension of `.py`. However, you can specify your own list with the `-e` (or `--ext`) switch like so:
```bash
nodemon -e js,pug
```
Now nodemon will restart on any changes to files in the directory (or subdirectories) with the extensions `.js`, `.pug`.
## Ignoring files
By default, nodemon will only restart when a `.js` JavaScript file changes. In some cases you will want to ignore some specific files, directories or file patterns, to prevent nodemon from prematurely restarting your application.
This can be done via the command line:
```bash
nodemon --ignore lib/ --ignore tests/
```
Or specific files can be ignored:
```bash
nodemon --ignore lib/app.js
```
Patterns can also be ignored (but be sure to quote the arguments):
```bash
nodemon --ignore 'lib/*.js'
```
**Important** the ignore rules are patterns matched to the full absolute path, and this determines how many files are monitored. If using a wild card glob pattern, it needs to be used as `**` or omitted entirely. For example, `nodemon --ignore '**/test/**'` will work, whereas `--ignore '*/test/*'` will not.
Note that by default, nodemon will ignore the `.git`, `node_modules`, `bower_components`, `.nyc_output`, `coverage` and `.sass-cache` directories and *add* your ignored patterns to the list. If you want to indeed watch a directory like `node_modules`, you need to [override the underlying default ignore rules](https://github.com/remy/nodemon/blob/master/faq.md#overriding-the-underlying-default-ignore-rules).
## Application isn't restarting
In some networked environments (such as a container running nodemon reading across a mounted drive), you will need to use the `legacyWatch: true` which enables Chokidar's polling.
Via the CLI, use either `--legacy-watch` or `-L` for short:
```bash
nodemon -L
```
Though this should be a last resort as it will poll every file it can find.
## Delaying restarting
In some situations, you may want to wait until a number of files have changed. The timeout before checking for new file changes is 1 second. If you're uploading a number of files and it's taking some number of seconds, this could cause your app to restart multiple times unnecessarily.
To add an extra throttle, or delay restarting, use the `--delay` command:
```bash
nodemon --delay 10 server.js
```
For more precision, milliseconds can be specified. Either as a float:
```bash
nodemon --delay 2.5 server.js
```
Or using the time specifier (ms):
```bash
nodemon --delay 2500ms server.js
```
The delay figure is number of seconds (or milliseconds, if specified) to delay before restarting. So nodemon will only restart your app the given number of seconds after the *last* file change.
If you are setting this value in `nodemon.json`, the value will always be interpreted in milliseconds. E.g., the following are equivalent:
```bash
nodemon --delay 2.5
{
"delay": 2500
}
```
## Gracefully reloading down your script
It is possible to have nodemon send any signal that you specify to your application.
```bash
nodemon --signal SIGHUP server.js
```
Your application can handle the signal as follows.
```js
process.once("SIGHUP", function () {
reloadSomeConfiguration();
})
```
Please note that nodemon will send this signal to every process in the process tree.
If you are using `cluster`, then each workers (as well as the master) will receive the signal. If you wish to terminate all workers on receiving a `SIGHUP`, a common pattern is to catch the `SIGHUP` in the master, and forward `SIGTERM` to all workers, while ensuring that all workers ignore `SIGHUP`.
```js
if (cluster.isMaster) {
process.on("SIGHUP", function () {
for (const worker of Object.values(cluster.workers)) {
worker.process.kill("SIGTERM");
}
});
} else {
process.on("SIGHUP", function() {})
}
```
## Controlling shutdown of your script
nodemon sends a kill signal to your application when it sees a file update. If you need to clean up on shutdown inside your script you can capture the kill signal and handle it yourself.
The following example will listen once for the `SIGUSR2` signal (used by nodemon to restart), run the clean up process and then kill itself for nodemon to continue control:
```js
process.once('SIGUSR2', function () {
gracefulShutdown(function () {
process.kill(process.pid, 'SIGUSR2');
});
});
```
Note that the `process.kill` is *only* called once your shutdown jobs are complete. Hat tip to [Benjie Gillam](http://www.benjiegillam.com/2011/08/node-js-clean-restart-and-faster-development-with-nodemon/) for writing this technique up.
## Triggering events when nodemon state changes
If you want growl like notifications when nodemon restarts or to trigger an action when an event happens, then you can either `require` nodemon or add event actions to your `nodemon.json` file.
For example, to trigger a notification on a Mac when nodemon restarts, `nodemon.json` looks like this:
```json
{
"events": {
"restart": "osascript -e 'display notification \"app restarted\" with title \"nodemon\"'"
}
}
```
A full list of available events is listed on the [event states wiki](https://github.com/remy/nodemon/wiki/Events#states). Note that you can bind to both states and messages.
## Pipe output to somewhere else
```js
nodemon({
script: ...,
stdout: false // important: this tells nodemon not to output to console
}).on('readable', function() { // the `readable` event indicates that data is ready to pick up
this.stdout.pipe(fs.createWriteStream('output.txt'));
this.stderr.pipe(fs.createWriteStream('err.txt'));
});
```
## Using nodemon in your gulp workflow
Check out the [gulp-nodemon](https://github.com/JacksonGariety/gulp-nodemon) plugin to integrate nodemon with the rest of your project's gulp workflow.
## Using nodemon in your Grunt workflow
Check out the [grunt-nodemon](https://github.com/ChrisWren/grunt-nodemon) plugin to integrate nodemon with the rest of your project's grunt workflow.
## Pronunciation
> nodemon, is it pronounced: node-mon, no-demon or node-e-mon (like pokémon)?
Well...I've been asked this many times before. I like that I've been asked this before. There's been bets as to which one it actually is.
The answer is simple, but possibly frustrating. I'm not saying (how I pronounce it). It's up to you to call it as you like. All answers are correct :)
## Design principles
- Fewer flags is better
- Works across all platforms
- Fewer features
- Let individuals build on top of nodemon
- Offer all CLI functionality as an API
- Contributions must have and pass tests
Nodemon is not perfect, and CLI arguments has sprawled beyond where I'm completely happy, but perhaps it can be reduced a little one day.
## FAQ
See the [FAQ](https://github.com/remy/nodemon/blob/master/faq.md) and please add your own questions if you think they would help others.
## Backers
Thank you to all [our backers](https://opencollective.com/nodemon#backer)! 🙏
[![nodemon backers](https://opencollective.com/nodemon/backers.svg?width=890)](https://opencollective.com/nodemon#backers)
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Sponsor this project today ❤️](https://opencollective.com/nodemon#sponsor)
<div style="overflow: hidden; margin-bottom: 80px;"><a title='Netpositive' data-id='162674' href='https://najlepsibukmacherzy.pl/ranking-legalnych-bukmacherow/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/52acecf0-608a-11eb-b17f-5bca7c67fe7b.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='CasinoHEX Australia' data-id='177373' href='https://online-aussie-casino.com/'><img alt='#1 Aussie Gambling Guide' src='https://opencollective-production.s3.us-west-1.amazonaws.com/89ea5890-6d1c-11ea-9dd9-330b3b2faf8b.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='NettiCasinoHEX.com' data-id='177375' href='https://netticasinohex.com/'><img alt='NettiCasinoHEX.com is a real giant among casino guides. It provides Finnish players with the most informative and honest casino rewievs. Beside that, there are free casino games and tips there which help to win the best jackpots.' src='https://opencollective-production.s3.us-west-1.amazonaws.com/b802aa50-7b1a-11ea-bcaf-0dc68ad9bc17.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='KasynoHEX' data-id='177376' href='https://polskiekasynohex.org/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/2bb0d6e0-99c8-11ea-9349-199aa0d5d24a.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Casinoonlineaams.com' data-id='198634' href='https://www.casinoonlineaams.com'><img alt='Casinoonlineaams.com' src='https://opencollective-production.s3.us-west-1.amazonaws.com/61bcf1d0-43ce-11ed-b562-6bf567fce1fd.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Aussielowdepositcasino' data-id='215800' href='https://aussielowdepositcasino.com/'><img alt='aussielowdepositcasino.com' src='https://user-images.githubusercontent.com/13700/151881982-04677f3d-e2e1-44ee-a168-258b242b1ef4.svg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Casinot.net' data-id='220487' href='https://www.casinot.net'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/73b4fc10-7591-11ea-a1d4-01a20d893b4f.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Kasinot.fi' data-id='229606' href='https://www.kasinot.fi'><img alt='null' src='https://logo.clearbit.com/www.kasinot.fi' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Casino Wise' data-id='243140' href='https://casino-wise.com/'><img alt='The UKs number one place for all things GamStop.' src='https://opencollective-production.s3.us-west-1.amazonaws.com/734011b0-46ac-11eb-8d3c-79b2cf7dfe51.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Paraskasino' data-id='248269' href='https://www.paraskasino.fi'><img alt='null' src='https://logo.clearbit.com/www.paraskasino.fi' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='freebets.ltd.uk' data-id='269861' href='https://freebets.ltd.uk/'><img alt='freebets.ltd.uk' src='https://logo.clearbit.com/freebets.ltd.uk' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='null' data-id='padlet' href='https://padlet.com'><img alt='null' src='https://images.opencollective.com/padlet/320fa3e/logo/256.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Casino Utan Svenska Licensen' data-id='285700' href='https://www.casinoutansvenskalicensen.se/'><img alt='Marketing' src='https://opencollective-production.s3.us-west-1.amazonaws.com/ed105cb0-b01f-11ec-935f-77c14be20a90.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Online Casinos Australia' data-id='297999' href='https://online-casinos-australia.com/'><img alt='Best Online Casino Guide in Australia' src='https://opencollective-production.s3.us-west-1.amazonaws.com/88bb6d20-900a-11ec-8a5a-a92310c15e5b.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Betting sites Australia' data-id='303335' href='https://hellsbet.com/en-au/'><img alt='Rating of best betting sites in Australia' src='https://opencollective-production.s3.us-west-1.amazonaws.com/aeb99e10-d1ec-11ec-88be-f9a15ca9f6f8.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='inkedin' data-id='305884' href='https://inkedin.com'><img alt='null' src='https://logo.clearbit.com/inkedin.com' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='AU Internet Pokies' data-id='318650' href='http://www.australiainternetpokies.com/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/44dc83f0-4315-11ed-9bf2-cf65326f4741.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='CasinoAus' data-id='318653' href='https://www.casinoaus.net/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/1e556300-4315-11ed-b96e-8dce3aa4cf2e.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='AU Online Casinos' data-id='318656' href='https://www.australiaonlinecasinosites.com/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/f3aa3b60-2219-11ed-b2b0-83767ea0d654.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Top Australian Gambling' data-id='318659' href='https://www.topaustraliangambling.com/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/d7687f70-2219-11ed-a0b5-97427086b4aa.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Internet Pokies' data-id='318660' href='https://www.internetpokies.org/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/2eb12950-4315-11ed-83fe-b18a881c7be9.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Casinostranieri.net' data-id='319480' href='https://casinostranieri.net/'><img alt='' src='https://opencollective-production.s3.us-west-1.amazonaws.com/7aae8900-0c02-11ed-9aa8-2bd811fd6f10.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Goread.io' data-id='320564' href='https://goread.io/buy-instagram-followers'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/7d1302a0-0f33-11ed-a094-3dca78aec7cd.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='SureBet' data-id='321121' href='https://www.sure.bet/casinos-not-on-gamstop/'><img alt='We are the most advanced casino guide!' src='https://logo.clearbit.com/sure.bet' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Correct Casinos Australia' data-id='322445' href='https://www.correctcasinos.com/australian-online-casinos/'><img alt='Best Australian online casinos. Reviewed by Correct Casinos.' src='https://opencollective-production.s3.us-west-1.amazonaws.com/fef95200-1551-11ed-ba3f-410c614877c8.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='null' data-id='Empire Srls (double)' href='https://casinosicuri.info/'><img alt='casino online sicuri' src='https://user-images.githubusercontent.com/13700/183862257-d13855b6-68ad-4c06-a474-af1d6efcc430.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Casino utan svensk licens' data-id='326858' href='https://casinoburst.com/casino-utan-licens/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/ac61d790-1d3c-11ed-b8db-7b79b65b0dbb.PNG' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Vedonlyontibonukset.com' data-id='326863' href='https://www.vedonlyontibonukset.com/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/276ec220-df06-11eb-a5cf-7b18267f7c27.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='spinsify.com/uk' data-id='326864' href='https://www.spinsify.com/uk/new-casinos'><img alt='' src='https://opencollective-production.s3.us-west-1.amazonaws.com/2bacf2f0-df04-11eb-a5cf-7b18267f7c27.PNG' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='uudetkasinot.com' data-id='326865' href='https://www.uudetkasinot.com'><img alt='' src='https://opencollective-production.s3.us-west-1.amazonaws.com/b6055950-df00-11eb-9caa-b58f40adecd5.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Gem M' data-id='327241' href='https://www.noneedtostudy.com/take-my-online-class/'><img alt='null' src='https://user-images.githubusercontent.com/13700/187039696-e2d8cd59-8b4e-438f-a052-69095212427d.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Best Slots World' data-id='329117' href='https://bestslotsworld.com/'><img alt='Best Online Casinos' src='https://logo.clearbit.com/bestslotsworld.com' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Slotmachineweb.com' data-id='329195' href='https://www.slotmachineweb.com/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/172f9eb0-22c2-11ed-a0b5-97427086b4aa.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Likewave' data-id='334265' href='https://likewave.io/buy-instagram-views'><img alt='Buy Instagram Views' src='https://opencollective-production.s3.us-west-1.amazonaws.com/ec927700-359e-11ed-97d0-014826afdf06.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Ghotala.com' data-id='342390' href='https://www.ghotala.com/'><img alt='Website dedicated to finding the best and safest licensed online casinos in India' src='https://opencollective-production.s3.us-west-1.amazonaws.com/75afa9e0-4ac6-11ed-8d6a-fdcc8c0d0736.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='CasinoWizard' data-id='344102' href='https://thecasinowizard.com/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/28b8d230-b9ab-11ec-8254-6d6dbd89fb51.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Scommesseseriea.eu' data-id='353466' href='https://www.scommesseseriea.eu/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/31600a10-4df4-11ed-a07e-95365d1687ba.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Gambe Online AU' data-id='356565' href='https://www.gambleonlineaustralia.com/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/a70354f0-337f-11ed-a5da-ebb8fe99a73a.JPG' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Gamble Online' data-id='356566' href='https://www.gambleonline.co'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/af336e80-337f-11ed-a5da-ebb8fe99a73a.JPG' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Italianonlinecasino.net' data-id='362210' href='https://www1.italianonlinecasino.net/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/2e8dbbb0-22bc-11ed-b874-23b20736a51e.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='NotOnGamstopCasinos.com' data-id='364516' href='https://www.notongamstopcasinos.com'><img alt='null' src='https://logo.clearbit.com/notongamstopcasinos.com' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='nongamstopcasinos.net' data-id='367236' href='https://nongamstopcasinos.net/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/fb8b5ba0-3904-11ed-8516-edd7b7687a36.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Incognito' data-id='368126' href='https://casinofrog.com/ca/online-casino/new/'><img alt='null' src='https://user-images.githubusercontent.com/13700/207157616-8b6d3dd2-e7de-4bbf-86b2-d6ad9fb714fb.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Broadband.Deals' data-id='369459' href='https://broadband.deals'><img alt='Broadband.deals' src='https://opencollective-production.s3.us-west-1.amazonaws.com/8e302e50-7a09-11ed-8da2-6f3e7f475696.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Scommesse777' data-id='370216' href='https://www.scommesse777.com/'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/c0346cb0-7ad4-11ed-a9cf-49dc3536976e.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Twicsy' data-id='371088' href='https://twicsy.com/buy-instagram-likes'><img alt='null' src='https://opencollective-production.s3.us-west-1.amazonaws.com/19bb95b0-7be3-11ed-8734-4d07568f9c95.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Casino Australia Online' data-id='380510' href='https://www.casinoaustraliaonline.com/under-1-hour-withdrawal-casinos/'><img alt='At Casinoaustraliaonline.com, we review, compare and list all the best gambling sites for Aussies.
' src='https://opencollective-production.s3.us-west-1.amazonaws.com/7c3d81f0-8cad-11ed-b048-95ec46716b47.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='awisee.agency' data-id='389303' href='https://awisee.agency'><img alt='Data-Driven SEO Agency' src='https://opencollective-production.s3.us-west-1.amazonaws.com/ac793f60-9d5d-11ed-b44f-7581c7ec656c.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Link Building Europe' data-id='391434' href='https://linkbuildingeurope.com'><img alt='We offer SEO Services in Europe. Scale your traffic and grow more users online via Google' src='https://opencollective-production.s3.us-west-1.amazonaws.com/6c21b540-8954-11ed-bf46-07ad171e1507.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Spin-Paradise' data-id='392125' href='https://spin-paradise.com'><img alt='Australia Online Casino Reviewer' src='https://opencollective-production.s3.us-west-1.amazonaws.com/15334aa0-4143-11ec-8d2d-053636eb5d04.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Spela på Casino utan svensk licens' data-id='404959' href='https://starwarscasinos.com/'><img alt='Casino utan svensk licens är online casinon som inte har en svensk spellicens. ' src='https://opencollective-production.s3.us-west-1.amazonaws.com/2bdb0670-75ca-11eb-a0a9-5d2848156276.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='iGaming SEO' data-id='405951' href='https://igamingseo.co'><img alt='We provide Marketing Services for the iGaming and Technology space ' src='https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/a40ca82f-3011-4cc1-88ba-128b42d03498/iGaming%20SEO.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Likes.io' data-id='406390' href='https://likes.io/buy-instagram-followers'><img alt='Likes.io is a social media engagement service that helps users increase their visibility and boost their online presence. With Likes.io, users can easily and quickly get more likes, followers, and views for their social media profiles, including Instagram' src='https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/e3b43423-dbe5-4ae6-9e50-1c0c6ded0f50/Likes.io%20Main%20Logo%202400x1800.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='BestUSCasinos' data-id='409421' href='https://bestuscasinos.org'><img alt='null' src='https://logo.clearbit.com/bestuscasinos.org' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='TightPoker' data-id='410184' href='https://www.tightpoker.com/'><img alt='null' src='https://logo.clearbit.com/tightpoker.com' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
<a title='Poprey.com' data-id='411448' href='https://poprey.com/'><img alt='Buy Instagram Likes' src='https://opencollective-production.s3.us-west-1.amazonaws.com/fe650970-c21c-11ec-a499-b55e54a794b4.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a>
</div>
# License
MIT [http://rem.mit-license.org](http://rem.mit-license.org)

16
node_modules/nodemon/bin/nodemon.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env node
const cli = require('../lib/cli');
const nodemon = require('../lib/');
const options = cli.parse(process.argv);
nodemon(options);
const fs = require('fs');
// checks for available update and returns an instance
const pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json'));
if (pkg.version.indexOf('0.0.0') !== 0 && options.noUpdateNotifier !== true) {
require('simple-update-notifier')({ pkg });
}

BIN
node_modules/nodemon/bin/windows-kill.exe generated vendored Normal file

Binary file not shown.

8
node_modules/nodemon/doc/cli/authors.txt generated vendored Normal file
View File

@@ -0,0 +1,8 @@
Remy Sharp - author and maintainer
https://github.com/remy
https://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
View File

@@ -0,0 +1,44 @@
Typically the options to control nodemon are passed in via the CLI and are
listed under: nodemon --help options
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"
}
}

29
node_modules/nodemon/doc/cli/help.txt generated vendored Normal file
View File

@@ -0,0 +1,29 @@
Usage: nodemon [options] [script.js] [args]
Options:
--config file ............ alternate nodemon.json config file to use
-e, --ext ................ extensions to look for, ie. js,pug,hbs.
-x, --exec app ........... execute script with "app", ie. -x "python -v".
-w, --watch path ......... watch directory "path" or files. use once for
each directory or file to watch.
-i, --ignore ............. ignore specific files or directories.
-V, --verbose ............ show detail on what is causing restarts.
-- <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, .mjs, .coffee,
.litcoffee, and .json by default.
For advanced nodemon configuration use nodemon.json: nodemon --help config
See also the sample: https://github.com/remy/nodemon/wiki/Sample-nodemon.json
Examples:
$ nodemon server.js
$ nodemon -w ../foo server.js apparg1 apparg2
$ nodemon --exec python app.py
$ nodemon --exec "make build" -e "styl hbs"
$ nodemon app.js -- --config # pass config to app.js
\x1B[1mAll options are documented under: \x1B[4mnodemon --help options\x1B[0m

20
node_modules/nodemon/doc/cli/logo.txt generated vendored Normal file
View 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

36
node_modules/nodemon/doc/cli/options.txt generated vendored Normal file
View File

@@ -0,0 +1,36 @@
Configuration
--config <file> .......... alternate nodemon.json config file to use
--exitcrash .............. exit on crash, allows nodemon to work with other watchers
-i, --ignore ............. ignore specific files or directories
--no-colors .............. disable color output
--signal <signal> ........ use specified kill signal instead of default (ex. SIGTERM)
-w, --watch path ......... watch directory "dir" or files. use once for each
directory or file to watch
--no-update-notifier ..... opt-out of update version check
Execution
-C, --on-change-only ..... execute script on change only, not startup
--cwd <dir> .............. change into <dir> before running the script
-e, --ext ................ extensions to look for, ie. "js,pug,hbs"
-I, --no-stdin ........... nodemon passes stdin directly to child process
--spawn .................. force nodemon to use spawn (over fork) [node only]
-x, --exec app ........... execute script with "app", ie. -x "python -v"
-- <your args> ........... to tell nodemon stop slurping arguments
Watching
-d, --delay n ............ debounce restart for "n" seconds
-L, --legacy-watch ....... use polling to watch for changes (typically needed
when watching over a network/Docker)
-P, --polling-interval ... combined with -L, milliseconds to poll for (default 100)
Information
--dump ................... print full debug configuration
-h, --help ............... default help
--help <topic> ........... help on a specific feature. Try "--help topics"
-q, --quiet .............. minimise nodemon messages to start/stop only
-v, --version ............ current nodemon version
-V, --verbose ............ show detail on what is causing restarts
> Note that any unrecognised arguments are passed to the executing command.

8
node_modules/nodemon/doc/cli/topics.txt generated vendored Normal file
View File

@@ -0,0 +1,8 @@
options .................. show all available nodemon options
config ................... default config options using nodemon.json
authors .................. contributors to this project
logo ..................... <3
whoami ................... I, AM, NODEMON \o/
Please support https://github.com/remy/nodemon/

3
node_modules/nodemon/doc/cli/usage.txt generated vendored Normal file
View 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
View File

@@ -0,0 +1,9 @@
__/\\\\\_____/\\\_______/\\\\\_______/\\\\\\\\\\\\_____/\\\\\\\\\\\\\\\__/\\\\____________/\\\\_______/\\\\\_______/\\\\\_____/\\\_
_\/\\\\\\___\/\\\_____/\\\///\\\____\/\\\////////\\\__\/\\\///////////__\/\\\\\\________/\\\\\\_____/\\\///\\\____\/\\\\\\___\/\\\_
_\/\\\/\\\__\/\\\___/\\\/__\///\\\__\/\\\______\//\\\_\/\\\_____________\/\\\//\\\____/\\\//\\\___/\\\/__\///\\\__\/\\\/\\\__\/\\\_
_\/\\\//\\\_\/\\\__/\\\______\//\\\_\/\\\_______\/\\\_\/\\\\\\\\\\\_____\/\\\\///\\\/\\\/_\/\\\__/\\\______\//\\\_\/\\\//\\\_\/\\\_
_\/\\\\//\\\\/\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/\\\///////______\/\\\__\///\\\/___\/\\\_\/\\\_______\/\\\_\/\\\\//\\\\/\\\_
_\/\\\_\//\\\/\\\_\//\\\______/\\\__\/\\\_______\/\\\_\/\\\_____________\/\\\____\///_____\/\\\_\//\\\______/\\\__\/\\\_\//\\\/\\\_
_\/\\\__\//\\\\\\__\///\\\__/\\\____\/\\\_______/\\\__\/\\\_____________\/\\\_____________\/\\\__\///\\\__/\\\____\/\\\__\//\\\\\\_
_\/\\\___\//\\\\\____\///\\\\\/_____\/\\\\\\\\\\\\/___\/\\\\\\\\\\\\\\\_\/\\\_____________\/\\\____\///\\\\\/_____\/\\\___\//\\\\\_
_\///_____\/////_______\/////_______\////////////_____\///////////////__\///______________\///_______\/////_______\///_____\/////__

49
node_modules/nodemon/lib/cli/index.js generated vendored Normal file
View File

@@ -0,0 +1,49 @@
var parse = require('./parse');
/**
* Converts a string to command line args, in particular
* groups together quoted values.
* This is a utility function to allow calling nodemon as a required
* library, but with the CLI args passed in (instead of an object).
*
* @param {String} string
* @return {Array}
*/
function stringToArgs(string) {
var args = [];
var parts = string.split(' ');
var length = parts.length;
var i = 0;
var open = false;
var grouped = '';
var lead = '';
for (; i < length; i++) {
lead = parts[i].substring(0, 1);
if (lead === '"' || lead === '\'') {
open = lead;
grouped = parts[i].substring(1);
} else if (open && parts[i].slice(-1) === open) {
open = false;
grouped += ' ' + parts[i].slice(0, -1);
args.push(grouped);
} else if (open) {
grouped += ' ' + parts[i];
} else {
args.push(parts[i]);
}
}
return args;
}
module.exports = {
parse: function (argv) {
if (typeof argv === 'string') {
argv = stringToArgs(argv);
}
return parse(argv);
},
};

230
node_modules/nodemon/lib/cli/parse.js generated vendored Normal file
View File

@@ -0,0 +1,230 @@
/*
nodemon is a utility for node, and replaces the use of the executable
node. So the user calls `nodemon foo.js` instead.
nodemon can be run in a number of ways:
`nodemon` - tries to use package.json#main property to run
`nodemon` - if no package, looks for index.js
`nodemon app.js` - runs app.js
`nodemon --arg app.js --apparg` - eats arg1, and runs app.js with apparg
`nodemon --apparg` - as above, but passes apparg to package.json#main (or
index.js)
`nodemon --debug app.js
*/
var fs = require('fs');
var path = require('path');
var existsSync = fs.existsSync || path.existsSync;
module.exports = parse;
/**
* Parses the command line arguments `process.argv` and returns the
* nodemon options, the user script and the executable script.
*
* @param {Array} full process arguments, including `node` leading arg
* @return {Object} { options, script, args }
*/
function parse(argv) {
if (typeof argv === 'string') {
argv = argv.split(' ');
}
var eat = function (i, args) {
if (i <= args.length) {
return args.splice(i + 1, 1).pop();
}
};
var args = argv.slice(2);
var script = null;
var nodemonOptions = { scriptPosition: null };
var nodemonOpt = nodemonOption.bind(null, nodemonOptions);
var lookForArgs = true;
// move forward through the arguments
for (var i = 0; i < args.length; i++) {
// if the argument looks like a file, then stop eating
if (!script) {
if (args[i] === '.' || existsSync(args[i])) {
script = args.splice(i, 1).pop();
// we capture the position of the script because we'll reinsert it in
// the right place in run.js:command (though I'm not sure we should even
// take it out of the array in the first place, but this solves passing
// arguments to the exec process for now).
nodemonOptions.scriptPosition = i;
i--;
continue;
}
}
if (lookForArgs) {
// respect the standard way of saying: hereafter belongs to my script
if (args[i] === '--') {
args.splice(i, 1);
nodemonOptions.scriptPosition = i;
// cycle back one argument, as we just ate this one up
i--;
// ignore all further nodemon arguments
lookForArgs = false;
// move to the next iteration
continue;
}
if (nodemonOpt(args[i], eat.bind(null, i, args)) !== false) {
args.splice(i, 1);
// cycle back one argument, as we just ate this one up
i--;
}
}
}
nodemonOptions.script = script;
nodemonOptions.args = args;
return nodemonOptions;
}
/**
* Given an argument (ie. from process.argv), sets nodemon
* options and can eat up the argument value
*
* @param {Object} options object that will be updated
* @param {Sting} current argument from argv
* @param {Function} the callback to eat up the next argument in argv
* @return {Boolean} false if argument was not a nodemon arg
*/
function nodemonOption(options, arg, eatNext) {
// line separation on purpose to help legibility
if (arg === '--help' || arg === '-h' || arg === '-?') {
var help = eatNext();
options.help = help ? help : true;
} else
if (arg === '--version' || arg === '-v') {
options.version = true;
} else
if (arg === '--no-update-notifier') {
options.noUpdateNotifier = true;
} else
if (arg === '--spawn') {
options.spawn = true;
} else
if (arg === '--dump') {
options.dump = true;
} else
if (arg === '--verbose' || arg === '-V') {
options.verbose = true;
} else
if (arg === '--legacy-watch' || arg === '-L') {
options.legacyWatch = true;
} else
if (arg === '--polling-interval' || arg === '-P') {
options.pollingInterval = parseInt(eatNext(), 10);
} else
// Depricated as this is "on" by default
if (arg === '--js') {
options.js = true;
} else
if (arg === '--quiet' || arg === '-q') {
options.quiet = true;
} else
if (arg === '--config') {
options.configFile = eatNext();
} else
if (arg === '--watch' || arg === '-w') {
if (!options.watch) { options.watch = []; }
options.watch.push(eatNext());
} else
if (arg === '--ignore' || arg === '-i') {
if (!options.ignore) { options.ignore = []; }
options.ignore.push(eatNext());
} else
if (arg === '--exitcrash') {
options.exitcrash = true;
} else
if (arg === '--delay' || arg === '-d') {
options.delay = parseDelay(eatNext());
} else
if (arg === '--exec' || arg === '-x') {
options.exec = eatNext();
} else
if (arg === '--no-stdin' || arg === '-I') {
options.stdin = false;
} else
if (arg === '--on-change-only' || arg === '-C') {
options.runOnChangeOnly = true;
} else
if (arg === '--ext' || arg === '-e') {
options.ext = eatNext();
} else
if (arg === '--no-colours' || arg === '--no-colors') {
options.colours = false;
} else
if (arg === '--signal' || arg === '-s') {
options.signal = eatNext();
} else
if (arg === '--cwd') {
options.cwd = eatNext();
// go ahead and change directory. This is primarily for nodemon tools like
// grunt-nodemon - we're doing this early because it will affect where the
// user script is searched for.
process.chdir(path.resolve(options.cwd));
} else {
// this means we didn't match
return false;
}
}
/**
* Given an argument (ie. from nodemonOption()), will parse and return the
* equivalent millisecond value or 0 if the argument cannot be parsed
*
* @param {String} argument value given to the --delay option
* @return {Number} millisecond equivalent of the argument
*/
function parseDelay(value) {
var millisPerSecond = 1000;
var millis = 0;
if (value.match(/^\d*ms$/)) {
// Explicitly parse for milliseconds when using ms time specifier
millis = parseInt(value, 10);
} else {
// Otherwise, parse for seconds, with or without time specifier then convert
millis = parseFloat(value) * millisPerSecond;
}
return isNaN(millis) ? 0 : millis;
}

43
node_modules/nodemon/lib/config/command.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
module.exports = command;
/**
* command constructs the executable command to run in a shell including the
* user script, the command arguments.
*
* @param {Object} settings Object as:
* { execOptions: {
* exec: String,
* [script: String],
* [scriptPosition: Number],
* [execArgs: Array<string>]
* }
* }
* @return {Object} an object with the node executable and the
* arguments to the command
*/
function command(settings) {
var options = settings.execOptions;
var executable = options.exec;
var args = [];
// after "executable" go the exec args (like --debug, etc)
if (options.execArgs) {
[].push.apply(args, options.execArgs);
}
// then goes the user's script arguments
if (options.args) {
[].push.apply(args, options.args);
}
// after the "executable" goes the user's script
if (options.script) {
args.splice((options.scriptPosition || 0) +
options.execArgs.length, 0, options.script);
}
return {
executable: executable,
args: args,
};
}

32
node_modules/nodemon/lib/config/defaults.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
var ignoreRoot = require('ignore-by-default').directories();
// default options for config.options
const defaults = {
restartable: 'rs',
colours: true,
execMap: {
py: 'python',
rb: 'ruby',
ts: 'ts-node',
// more can be added here such as ls: lsc - but please ensure it's cross
// compatible with linux, mac and windows, or make the default.js
// dynamically append the `.cmd` for node based utilities
},
ignoreRoot: ignoreRoot.map((_) => `**/${_}/**`),
watch: ['*.*'],
stdin: true,
runOnChangeOnly: false,
verbose: false,
signal: 'SIGUSR2',
// 'stdout' refers to the default behaviour of a required nodemon's child,
// but also includes stderr. If this is false, data is still dispatched via
// nodemon.on('stdout/stderr')
stdout: true,
watchOptions: {},
};
if ((process.env.NODE_OPTIONS || '').includes('--loader')) {
delete defaults.execMap.ts;
}
module.exports = defaults;

225
node_modules/nodemon/lib/config/exec.js generated vendored Normal file
View File

@@ -0,0 +1,225 @@
const path = require('path');
const fs = require('fs');
const existsSync = fs.existsSync;
const utils = require('../utils');
module.exports = exec;
module.exports.expandScript = expandScript;
/**
* Reads the cwd/package.json file and looks to see if it can load a script
* and possibly an exec first from package.main, then package.start.
*
* @return {Object} exec & script if found
*/
function execFromPackage() {
// doing a try/catch because we can't use the path.exist callback pattern
// or we could, but the code would get messy, so this will do exactly
// what we're after - if the file doesn't exist, it'll throw.
try {
// note: this isn't nodemon's package, it's the user's cwd package
var pkg = require(path.join(process.cwd(), 'package.json'));
if (pkg.main !== undefined) {
// no app found to run - so give them a tip and get the feck out
return { exec: null, script: pkg.main };
}
if (pkg.scripts && pkg.scripts.start) {
return { exec: pkg.scripts.start };
}
} catch (e) { }
return null;
}
function replace(map, str) {
var re = new RegExp('{{(' + Object.keys(map).join('|') + ')}}', 'g');
return str.replace(re, function (all, m) {
return map[m] || all || '';
});
}
function expandScript(script, ext) {
if (!ext) {
ext = '.js';
}
if (script.indexOf(ext) !== -1) {
return script;
}
if (existsSync(path.resolve(script))) {
return script;
}
if (existsSync(path.resolve(script + ext))) {
return script + ext;
}
return script;
}
/**
* Discovers all the options required to run the script
* and if a custom exec has been passed in, then it will
* also try to work out what extensions to monitor and
* whether there's a special way of running that script.
*
* @param {Object} nodemonOptions
* @param {Object} execMap
* @return {Object} new and updated version of nodemonOptions
*/
function exec(nodemonOptions, execMap) {
if (!execMap) {
execMap = {};
}
var options = utils.clone(nodemonOptions || {});
var script;
// if there's no script passed, try to get it from the first argument
if (!options.script && (options.args || []).length) {
script = expandScript(options.args[0],
options.ext && ('.' + (options.ext || 'js').split(',')[0]));
// if the script was found, shift it off our args
if (script !== options.args[0]) {
options.script = script;
options.args.shift();
}
}
// if there's no exec found yet, then try to read it from the local
// package.json this logic used to sit in the cli/parse, but actually the cli
// should be parsed first, then the user options (via nodemon.json) then
// finally default down to pot shots at the directory via package.json
if (!options.exec && !options.script) {
var found = execFromPackage();
if (found !== null) {
if (found.exec) {
options.exec = found.exec;
}
if (!options.script) {
options.script = found.script;
}
if (Array.isArray(options.args) &&
options.scriptPosition === null) {
options.scriptPosition = options.args.length;
}
}
}
// var options = utils.clone(nodemonOptions || {});
script = path.basename(options.script || '');
var scriptExt = path.extname(script).slice(1);
var extension = options.ext;
if (extension === undefined) {
var isJS = scriptExt === 'js' || scriptExt === 'mjs';
extension = (isJS || !scriptExt) ? 'js,mjs' : scriptExt;
extension += ',json'; // Always watch JSON files
}
var execDefined = !!options.exec;
// allows the user to simplify cli usage:
// https://github.com/remy/nodemon/issues/195
// but always give preference to the user defined argument
if (!options.exec && execMap[scriptExt] !== undefined) {
options.exec = execMap[scriptExt];
execDefined = true;
}
options.execArgs = nodemonOptions.execArgs || [];
if (Array.isArray(options.exec)) {
options.execArgs = options.exec;
options.exec = options.execArgs.shift();
}
if (options.exec === undefined) {
options.exec = 'node';
} else {
// allow variable substitution for {{filename}} and {{pwd}}
var substitution = replace.bind(null, {
filename: options.script,
pwd: process.cwd(),
});
var newExec = substitution(options.exec);
if (newExec !== options.exec &&
options.exec.indexOf('{{filename}}') !== -1) {
options.script = null;
}
options.exec = newExec;
var newExecArgs = options.execArgs.map(substitution);
if (newExecArgs.join('') !== options.execArgs.join('')) {
options.execArgs = newExecArgs;
delete options.script;
}
}
if (options.exec === 'node' && options.nodeArgs && options.nodeArgs.length) {
options.execArgs = options.execArgs.concat(options.nodeArgs);
}
// note: indexOf('coffee') handles both .coffee and .litcoffee
if (!execDefined && options.exec === 'node' &&
scriptExt.indexOf('coffee') !== -1) {
options.exec = 'coffee';
// we need to get execArgs set before the script
// for example, in `nodemon --debug my-script.coffee --my-flag`, debug is an
// execArg, while my-flag is a script arg
var leadingArgs = (options.args || []).splice(0, options.scriptPosition);
options.execArgs = options.execArgs.concat(leadingArgs);
options.scriptPosition = 0;
if (options.execArgs.length > 0) {
// because this is the coffee executable, we need to combine the exec args
// into a single argument after the nodejs flag
options.execArgs = ['--nodejs', options.execArgs.join(' ')];
}
}
if (options.exec === 'coffee') {
// don't override user specified extension tracking
if (options.ext === undefined) {
if (extension) { extension += ','; }
extension += 'coffee,litcoffee';
}
// because windows can't find 'coffee', it needs the real file 'coffee.cmd'
if (utils.isWindows) {
options.exec += '.cmd';
}
}
// allow users to make a mistake on the extension to monitor
// converts .js, pug => js,pug
// BIG NOTE: user can't do this: nodemon -e *.js
// because the terminal will automatically expand the glob against
// the file system :(
extension = (extension.match(/[^,*\s]+/g) || [])
.map(ext => ext.replace(/^\./, ''))
.join(',');
options.ext = extension;
if (options.script) {
options.script = expandScript(options.script,
extension && ('.' + extension.split(',')[0]));
}
options.env = {};
// make sure it's an object (and since we don't have )
if (({}).toString.apply(nodemonOptions.env) === '[object Object]') {
options.env = utils.clone(nodemonOptions.env);
} else if (nodemonOptions.env !== undefined) {
throw new Error('nodemon env values must be an object: { PORT: 8000 }');
}
return options;
}

93
node_modules/nodemon/lib/config/index.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
/**
* Manages the internal config of nodemon, checking for the state of support
* with fs.watch, how nodemon can watch files (using find or fs methods).
*
* This is *not* the user's config.
*/
var debug = require('debug')('nodemon');
var load = require('./load');
var rules = require('../rules');
var utils = require('../utils');
var pinVersion = require('../version').pin;
var command = require('./command');
var rulesToMonitor = require('../monitor/match').rulesToMonitor;
var bus = utils.bus;
function reset() {
rules.reset();
config.dirs = [];
config.options = { ignore: [], watch: [], monitor: [] };
config.lastStarted = 0;
config.loaded = [];
}
var config = {
run: false,
system: {
cwd: process.cwd(),
},
required: false,
dirs: [],
timeout: 1000,
options: {},
};
/**
* Take user defined settings, then detect the local machine capability, then
* look for local and global nodemon.json files and merge together the final
* settings with the config for nodemon.
*
* @param {Object} settings user defined settings for nodemon (typically on
* the cli)
* @param {Function} ready callback fired once the config is loaded
*/
config.load = function (settings, ready) {
reset();
var config = this;
load(settings, config.options, config, function (options) {
config.options = options;
if (options.watch.length === 0) {
// this is to catch when the watch is left blank
options.watch.push('*.*');
}
if (options['watch_interval']) { // jshint ignore:line
options.watchInterval = options['watch_interval']; // jshint ignore:line
}
config.watchInterval = options.watchInterval || null;
if (options.signal) {
config.signal = options.signal;
}
var cmd = command(config.options);
config.command = {
raw: cmd,
string: utils.stringify(cmd.executable, cmd.args),
};
// now run automatic checks on system adding to the config object
options.monitor = rulesToMonitor(options.watch, options.ignore, config);
var cwd = process.cwd();
debug('config: dirs', config.dirs);
if (config.dirs.length === 0) {
config.dirs.unshift(cwd);
}
bus.emit('config:update', config);
pinVersion().then(function () {
ready(config);
}).catch(e => {
// this doesn't help testing, but does give exposure on syntax errors
console.error(e.stack);
setTimeout(() => { throw e; }, 0);
});
});
};
config.reset = reset;
module.exports = config;

256
node_modules/nodemon/lib/config/load.js generated vendored Normal file
View File

@@ -0,0 +1,256 @@
var debug = require('debug')('nodemon');
var fs = require('fs');
var path = require('path');
var exists = fs.exists || path.exists;
var utils = require('../utils');
var rules = require('../rules');
var parse = require('../rules/parse');
var exec = require('./exec');
var defaults = require('./defaults');
module.exports = load;
module.exports.mutateExecOptions = mutateExecOptions;
var existsSync = fs.existsSync || path.existsSync;
function findAppScript() {
// nodemon has been run alone, so try to read the package file
// or try to read the index.js file
if (existsSync('./index.js')) {
return 'index.js';
}
}
/**
* Load the nodemon config, first reading the global root/nodemon.json, then
* the local nodemon.json to the exec and then overwriting using any user
* specified settings (i.e. from the cli)
*
* @param {Object} settings user defined settings
* @param {Function} ready callback that receives complete config
*/
function load(settings, options, config, callback) {
config.loaded = [];
// first load the root nodemon.json
loadFile(options, config, utils.home, function (options) {
// then load the user's local configuration file
if (settings.configFile) {
options.configFile = path.resolve(settings.configFile);
}
loadFile(options, config, process.cwd(), function (options) {
// Then merge over with the user settings (parsed from the cli).
// Note that merge protects and favours existing values over new values,
// and thus command line arguments get priority
options = utils.merge(settings, options);
// legacy support
if (!Array.isArray(options.ignore)) {
options.ignore = [options.ignore];
}
if (!options.ignoreRoot) {
options.ignoreRoot = defaults.ignoreRoot;
}
// blend the user ignore and the default ignore together
if (options.ignoreRoot && options.ignore) {
if (!Array.isArray(options.ignoreRoot)) {
options.ignoreRoot = [options.ignoreRoot];
}
options.ignore = options.ignoreRoot.concat(options.ignore);
} else {
options.ignore = defaults.ignore.concat(options.ignore);
}
// add in any missing defaults
options = utils.merge(options, defaults);
if (!options.script && !options.exec) {
var found = findAppScript();
if (found) {
if (!options.args) {
options.args = [];
}
// if the script is found as a result of not being on the command
// line, then we move any of the pre double-dash args in execArgs
const n = options.scriptPosition === null ?
options.args.length : options.scriptPosition;
options.execArgs = (options.execArgs || [])
.concat(options.args.splice(0, n));
options.scriptPosition = null;
options.script = found;
}
}
mutateExecOptions(options);
if (options.quiet) {
utils.quiet();
}
if (options.verbose) {
utils.debug = true;
}
// simplify the ready callback to be called after the rules are normalised
// from strings to regexp through the rules lib. Note that this gets
// created *after* options is overwritten twice in the lines above.
var ready = function (options) {
normaliseRules(options, callback);
};
// if we didn't pick up a nodemon.json file & there's no cli ignores
// then try loading an old style .nodemonignore file
if (config.loaded.length === 0) {
var legacy = loadLegacyIgnore.bind(null, options, config, ready);
// first try .nodemonignore, if that doesn't exist, try nodemon-ignore
return legacy('.nodemonignore', function () {
legacy('nodemon-ignore', function (options) {
ready(options);
});
});
}
ready(options);
});
});
}
/**
* Loads the old style nodemonignore files which is a list of patterns
* in a file to ignore
*
* @param {Object} options nodemon user options
* @param {Function} success
* @param {String} filename ignore file (.nodemonignore or nodemon-ignore)
* @param {Function} fail (optional) failure callback
*/
function loadLegacyIgnore(options, config, success, filename, fail) {
var ignoreFile = path.join(process.cwd(), filename);
exists(ignoreFile, function (exists) {
if (exists) {
config.loaded.push(ignoreFile);
return parse(ignoreFile, function (error, rules) {
options.ignore = rules.raw;
success(options);
});
}
if (fail) {
fail(options);
} else {
success(options);
}
});
}
function normaliseRules(options, ready) {
// convert ignore and watch options to rules/regexp
rules.watch.add(options.watch);
rules.ignore.add(options.ignore);
// normalise the watch and ignore arrays
options.watch = options.watch === false ? false : rules.rules.watch;
options.ignore = rules.rules.ignore;
ready(options);
}
/**
* Looks for a config in the current working directory, and a config in the
* user's home directory, merging the two together, giving priority to local
* config. This can then be overwritten later by command line arguments
*
* @param {Function} ready callback to pass loaded settings to
*/
function loadFile(options, config, dir, ready) {
if (!ready) {
ready = function () { };
}
var callback = function (settings) {
// prefer the local nodemon.json and fill in missing items using
// the global options
ready(utils.merge(settings, options));
};
if (!dir) {
return callback({});
}
var filename = options.configFile || path.join(dir, 'nodemon.json');
if (config.loaded.indexOf(filename) !== -1) {
// don't bother re-parsing the same config file
return callback({});
}
fs.readFile(filename, 'utf8', function (err, data) {
if (err) {
if (err.code === 'ENOENT') {
if (!options.configFile && dir !== utils.home) {
// if no specified local config file and local nodemon.json
// doesn't exist, try the package.json
return loadPackageJSON(config, callback);
}
}
return callback({});
}
var settings = {};
try {
settings = JSON.parse(data.toString('utf8').replace(/^\uFEFF/, ''));
if (!filename.endsWith('package.json') || settings.nodemonConfig) {
config.loaded.push(filename);
}
} catch (e) {
utils.log.fail('Failed to parse config ' + filename);
console.error(e);
process.exit(1);
}
// options values will overwrite settings
callback(settings);
});
}
function loadPackageJSON(config, ready) {
if (!ready) {
ready = () => { };
}
const dir = process.cwd();
const filename = path.join(dir, 'package.json');
const packageLoadOptions = { configFile: filename };
return loadFile(packageLoadOptions, config, dir, settings => {
ready(settings.nodemonConfig || {});
});
}
function mutateExecOptions(options) {
// work out the execOptions based on the final config we have
options.execOptions = exec({
script: options.script,
exec: options.exec,
args: options.args,
scriptPosition: options.scriptPosition,
nodeArgs: options.nodeArgs,
execArgs: options.execArgs,
ext: options.ext,
env: options.env,
}, options.execMap);
// clean up values that we don't need at the top level
delete options.scriptPosition;
delete options.script;
delete options.args;
delete options.ext;
return options;
}

27
node_modules/nodemon/lib/help/index.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
var fs = require('fs');
var path = require('path');
const supportsColor = require('supports-color');
module.exports = help;
const highlight = supportsColor.stdout ? '\x1B\[$1m' : '';
function help(item) {
if (!item) {
item = 'help';
} else if (item === true) { // if used with -h or --help and no args
item = 'help';
}
// cleanse the filename to only contain letters
// aka: /\W/g but figured this was eaiser to read
item = item.replace(/[^a-z]/gi, '');
try {
var dir = path.join(__dirname, '..', '..', 'doc', 'cli', item + '.txt');
var body = fs.readFileSync(dir, 'utf8');
return body.replace(/\\x1B\[(.)m/g, highlight);
} catch (e) {
return '"' + item + '" help can\'t be found';
}
}

1
node_modules/nodemon/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require('./nodemon');

4
node_modules/nodemon/lib/monitor/index.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
module.exports = {
run: require('./run'),
watch: require('./watch').watch,
};

276
node_modules/nodemon/lib/monitor/match.js generated vendored Normal file
View File

@@ -0,0 +1,276 @@
const minimatch = require('minimatch');
const path = require('path');
const fs = require('fs');
const debug = require('debug')('nodemon:match');
const utils = require('../utils');
module.exports = match;
module.exports.rulesToMonitor = rulesToMonitor;
function rulesToMonitor(watch, ignore, config) {
var monitor = [];
if (!Array.isArray(ignore)) {
if (ignore) {
ignore = [ignore];
} else {
ignore = [];
}
}
if (!Array.isArray(watch)) {
if (watch) {
watch = [watch];
} else {
watch = [];
}
}
if (watch && watch.length) {
monitor = utils.clone(watch);
}
if (ignore) {
[].push.apply(monitor, (ignore || []).map(function (rule) {
return '!' + rule;
}));
}
var cwd = process.cwd();
// next check if the monitored paths are actual directories
// or just patterns - and expand the rule to include *.*
monitor = monitor.map(function (rule) {
var not = rule.slice(0, 1) === '!';
if (not) {
rule = rule.slice(1);
}
if (rule === '.' || rule === '.*') {
rule = '*.*';
}
var dir = path.resolve(cwd, rule);
try {
var stat = fs.statSync(dir);
if (stat.isDirectory()) {
rule = dir;
if (rule.slice(-1) !== '/') {
rule += '/';
}
rule += '**/*';
// `!not` ... sorry.
if (!not) {
config.dirs.push(dir);
}
} else {
// ensures we end up in the check that tries to get a base directory
// and then adds it to the watch list
throw new Error();
}
} catch (e) {
var base = tryBaseDir(dir);
if (!not && base) {
if (config.dirs.indexOf(base) === -1) {
config.dirs.push(base);
}
}
}
if (rule.slice(-1) === '/') {
// just slap on a * anyway
rule += '*';
}
// if the url ends with * but not **/* and not *.*
// then convert to **/* - somehow it was missed :-\
if (rule.slice(-4) !== '**/*' &&
rule.slice(-1) === '*' &&
rule.indexOf('*.') === -1) {
if (rule.slice(-2) !== '**') {
rule += '*/*';
}
}
return (not ? '!' : '') + rule;
});
return monitor;
}
function tryBaseDir(dir) {
var stat;
if (/[?*\{\[]+/.test(dir)) { // if this is pattern, then try to find the base
try {
var base = path.dirname(dir.replace(/([?*\{\[]+.*$)/, 'foo'));
stat = fs.statSync(base);
if (stat.isDirectory()) {
return base;
}
} catch (error) {
// console.log(error);
}
} else {
try {
stat = fs.statSync(dir);
// if this path is actually a single file that exists, then just monitor
// that, *specifically*.
if (stat.isFile() || stat.isDirectory()) {
return dir;
}
} catch (e) { }
}
return false;
}
function match(files, monitor, ext) {
// sort the rules by highest specificity (based on number of slashes)
// ignore rules (!) get sorted highest as they take precedent
const cwd = process.cwd();
var rules = monitor.sort(function (a, b) {
var r = b.split(path.sep).length - a.split(path.sep).length;
var aIsIgnore = a.slice(0, 1) === '!';
var bIsIgnore = b.slice(0, 1) === '!';
if (aIsIgnore || bIsIgnore) {
if (aIsIgnore) {
return -1;
}
return 1;
}
if (r === 0) {
return b.length - a.length;
}
return r;
}).map(function (s) {
var prefix = s.slice(0, 1);
if (prefix === '!') {
if (s.indexOf('!' + cwd) === 0) {
return s;
}
// if it starts with a period, then let's get the relative path
if (s.indexOf('!.') === 0) {
return '!' + path.resolve(cwd, s.substring(1));
}
return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1);
}
// if it starts with a period, then let's get the relative path
if (s.indexOf('.') === 0) {
return path.resolve(cwd, s);
}
if (s.indexOf(cwd) === 0) {
return s;
}
return '**' + (prefix !== path.sep ? path.sep : '') + s;
});
debug('rules', rules);
var good = [];
var whitelist = []; // files that we won't check against the extension
var ignored = 0;
var watched = 0;
var usedRules = [];
var minimatchOpts = {
dot: true,
};
// enable case-insensitivity on Windows
if (utils.isWindows) {
minimatchOpts.nocase = true;
}
files.forEach(function (file) {
file = path.resolve(cwd, file);
var matched = false;
for (var i = 0; i < rules.length; i++) {
if (rules[i].slice(0, 1) === '!') {
if (!minimatch(file, rules[i], minimatchOpts)) {
debug('ignored', file, 'rule:', rules[i]);
ignored++;
matched = true;
break;
}
} else {
debug('matched', file, 'rule:', rules[i]);
if (minimatch(file, rules[i], minimatchOpts)) {
watched++;
// don't repeat the output if a rule is matched
if (usedRules.indexOf(rules[i]) === -1) {
usedRules.push(rules[i]);
utils.log.detail('matched rule: ' + rules[i]);
}
// if the rule doesn't match the WATCH EVERYTHING
// but *does* match a rule that ends with *.*, then
// white list it - in that we don't run it through
// the extension check too.
if (rules[i] !== '**' + path.sep + '*.*' &&
rules[i].slice(-3) === '*.*') {
whitelist.push(file);
} else if (path.basename(file) === path.basename(rules[i])) {
// if the file matches the actual rule, then it's put on whitelist
whitelist.push(file);
} else {
good.push(file);
}
matched = true;
break;
} else {
// utils.log.detail('no match: ' + rules[i], file);
}
}
}
if (!matched) {
ignored++;
}
});
debug('good', good)
// finally check the good files against the extensions that we're monitoring
if (ext) {
if (ext.indexOf(',') === -1) {
ext = '**/*.' + ext;
} else {
ext = '**/*.{' + ext + '}';
}
good = good.filter(function (file) {
// only compare the filename to the extension test
return minimatch(path.basename(file), ext, minimatchOpts);
});
} // else assume *.*
var result = good.concat(whitelist);
if (utils.isWindows) {
// fix for windows testing - I *think* this is okay to do
result = result.map(function (file) {
return file.slice(0, 1).toLowerCase() + file.slice(1);
});
}
return {
result: result,
ignored: ignored,
watched: watched,
total: files.length,
};
}

546
node_modules/nodemon/lib/monitor/run.js generated vendored Normal file
View File

@@ -0,0 +1,546 @@
var debug = require('debug')('nodemon:run');
const statSync = require('fs').statSync;
var utils = require('../utils');
var bus = utils.bus;
var childProcess = require('child_process');
var spawn = childProcess.spawn;
var exec = childProcess.exec;
var execSync = childProcess.execSync;
var fork = childProcess.fork;
var watch = require('./watch').watch;
var config = require('../config');
var child = null; // the actual child process we spawn
var killedAfterChange = false;
var noop = () => {};
var restart = null;
var psTree = require('pstree.remy');
var path = require('path');
var signals = require('./signals');
const osRelease = parseInt(require('os').release().split('.')[0], 10);
function run(options) {
var cmd = config.command.raw;
// moved up
// we need restart function below in the global scope for run.kill
/*jshint validthis:true*/
restart = run.bind(this, options);
run.restart = restart;
// binding options with instance of run
// so that we can use it in run.kill
run.options = options;
var runCmd = !options.runOnChangeOnly || config.lastStarted !== 0;
if (runCmd) {
utils.log.status('starting `' + config.command.string + '`');
} else {
// should just watch file if command is not to be run
// had another alternate approach
// to stop process being forked/spawned in the below code
// but this approach does early exit and makes code cleaner
debug('start watch on: %s', config.options.watch);
if (config.options.watch !== false) {
watch();
return;
}
}
config.lastStarted = Date.now();
var stdio = ['pipe', 'pipe', 'pipe'];
if (config.options.stdout) {
stdio = ['pipe', process.stdout, process.stderr];
}
if (config.options.stdin === false) {
stdio = [process.stdin, process.stdout, process.stderr];
}
var sh = 'sh';
var shFlag = '-c';
const binPath = process.cwd() + '/node_modules/.bin';
const spawnOptions = {
env: Object.assign({}, process.env, options.execOptions.env, {
PATH: binPath + path.delimiter + process.env.PATH,
}),
stdio: stdio,
};
var executable = cmd.executable;
if (utils.isWindows) {
// if the exec includes a forward slash, reverse it for windows compat
// but *only* apply to the first command, and none of the arguments.
// ref #1251 and #1236
if (executable.indexOf('/') !== -1) {
executable = executable
.split(' ')
.map((e, i) => {
if (i === 0) {
return path.normalize(e);
}
return e;
})
.join(' ');
}
// taken from npm's cli: https://git.io/vNFD4
sh = process.env.comspec || 'cmd';
shFlag = '/d /s /c';
spawnOptions.windowsVerbatimArguments = true;
spawnOptions.windowsHide = true;
}
var args = runCmd ? utils.stringify(executable, cmd.args) : ':';
var spawnArgs = [sh, [shFlag, args], spawnOptions];
const firstArg = cmd.args[0] || '';
var inBinPath = false;
try {
inBinPath = statSync(`${binPath}/${executable}`).isFile();
} catch (e) {}
// hasStdio allows us to correctly handle stdin piping
// see: https://git.io/vNtX3
const hasStdio = utils.satisfies('>= 6.4.0 || < 5');
// forking helps with sub-process handling and tends to clean up better
// than spawning, but it should only be used under specific conditions
const shouldFork =
!config.options.spawn &&
!inBinPath &&
!(firstArg.indexOf('-') === 0) && // don't fork if there's a node exec arg
firstArg !== 'inspect' && // don't fork it's `inspect` debugger
executable === 'node' && // only fork if node
utils.version.major > 4; // only fork if node version > 4
if (shouldFork) {
// this assumes the first argument is the script and slices it out, since
// we're forking
var forkArgs = cmd.args.slice(1);
var env = utils.merge(options.execOptions.env, process.env);
stdio.push('ipc');
const forkOptions = {
env: env,
stdio: stdio,
silent: !hasStdio,
};
if (utils.isWindows) {
forkOptions.windowsHide = true;
}
child = fork(options.execOptions.script, forkArgs, forkOptions);
utils.log.detail('forking');
debug('fork', sh, shFlag, args);
} else {
utils.log.detail('spawning');
child = spawn.apply(null, spawnArgs);
debug('spawn', sh, shFlag, args);
}
if (config.required) {
var emit = {
stdout: function (data) {
bus.emit('stdout', data);
},
stderr: function (data) {
bus.emit('stderr', data);
},
};
// now work out what to bind to...
if (config.options.stdout) {
child.on('stdout', emit.stdout).on('stderr', emit.stderr);
} else {
child.stdout.on('data', emit.stdout);
child.stderr.on('data', emit.stderr);
bus.stdout = child.stdout;
bus.stderr = child.stderr;
}
if (shouldFork) {
child.on('message', function (message, sendHandle) {
bus.emit('message', message, sendHandle);
});
}
}
bus.emit('start');
utils.log.detail('child pid: ' + child.pid);
child.on('error', function (error) {
bus.emit('error', error);
if (error.code === 'ENOENT') {
utils.log.error('unable to run executable: "' + cmd.executable + '"');
process.exit(1);
} else {
utils.log.error('failed to start child process: ' + error.code);
throw error;
}
});
child.on('exit', function (code, signal) {
if (child && child.stdin) {
process.stdin.unpipe(child.stdin);
}
if (code === 127) {
utils.log.error(
'failed to start process, "' + cmd.executable + '" exec not found'
);
bus.emit('error', code);
process.exit();
}
// If the command failed with code 2, it may or may not be a syntax error
// See: http://git.io/fNOAR
// We will only assume a parse error, if the child failed quickly
if (code === 2 && Date.now() < config.lastStarted + 500) {
utils.log.error('process failed, unhandled exit code (2)');
utils.log.error('');
utils.log.error('Either the command has a syntax error,');
utils.log.error('or it is exiting with reserved code 2.');
utils.log.error('');
utils.log.error('To keep nodemon running even after a code 2,');
utils.log.error('add this to the end of your command: || exit 1');
utils.log.error('');
utils.log.error('Read more here: https://git.io/fNOAG');
utils.log.error('');
utils.log.error('nodemon will stop now so that you can fix the command.');
utils.log.error('');
bus.emit('error', code);
process.exit();
}
// In case we killed the app ourselves, set the signal thusly
if (killedAfterChange) {
killedAfterChange = false;
signal = config.signal;
}
// this is nasty, but it gives it windows support
if (utils.isWindows && signal === 'SIGTERM') {
signal = config.signal;
}
if (signal === config.signal || code === 0) {
// this was a clean exit, so emit exit, rather than crash
debug('bus.emit(exit) via ' + config.signal);
bus.emit('exit', signal);
// exit the monitor, but do it gracefully
if (signal === config.signal) {
return restart();
}
if (code === 0) {
// clean exit - wait until file change to restart
if (runCmd) {
utils.log.status('clean exit - waiting for changes before restart');
}
child = null;
}
} else {
bus.emit('crash');
if (options.exitcrash) {
utils.log.fail('app crashed');
if (!config.required) {
process.exit(1);
}
} else {
utils.log.fail(
'app crashed - waiting for file changes before' + ' starting...'
);
child = null;
}
}
if (config.options.restartable) {
// stdin needs to kick in again to be able to listen to the
// restart command
process.stdin.resume();
}
});
// moved the run.kill outside to handle both the cases
// intial start
// no start
// connect stdin to the child process (options.stdin is on by default)
if (options.stdin) {
process.stdin.resume();
// FIXME decide whether or not we need to decide the encoding
// process.stdin.setEncoding('utf8');
// swallow the stdin error if it happens
// ref: https://github.com/remy/nodemon/issues/1195
if (hasStdio) {
child.stdin.on('error', () => {});
process.stdin.pipe(child.stdin);
} else {
if (child.stdout) {
child.stdout.pipe(process.stdout);
} else {
utils.log.error(
'running an unsupported version of node ' + process.version
);
utils.log.error(
'nodemon may not work as expected - ' +
'please consider upgrading to LTS'
);
}
}
bus.once('exit', function () {
if (child && process.stdin.unpipe) {
// node > 0.8
process.stdin.unpipe(child.stdin);
}
});
}
debug('start watch on: %s', config.options.watch);
if (config.options.watch !== false) {
watch();
}
}
function waitForSubProcesses(pid, callback) {
debug('checking ps tree for pids of ' + pid);
psTree(pid, (err, pids) => {
if (!pids.length) {
return callback();
}
utils.log.status(
`still waiting for ${pids.length} sub-process${
pids.length > 2 ? 'es' : ''
} to finish...`
);
setTimeout(() => waitForSubProcesses(pid, callback), 1000);
});
}
function kill(child, signal, callback) {
if (!callback) {
callback = noop;
}
if (utils.isWindows) {
const taskKill = () => {
try {
exec('taskkill /pid ' + child.pid + ' /T /F');
} catch (e) {
utils.log.error('Could not shutdown sub process cleanly');
}
};
// We are handling a 'SIGKILL' , 'SIGUSR2' and 'SIGUSR1' POSIX signal under Windows the
// same way it is handled on a UNIX system: We are performing
// a hard shutdown without waiting for the process to clean-up.
if (signal === 'SIGKILL' || osRelease < 10 || signal === 'SIGUSR2' || signal==="SIGUSR1" ) {
debug('terminating process group by force: %s', child.pid);
// We are using the taskkill utility to terminate the whole
// process group ('/t') of the child ('/pid') by force ('/f').
// We need to end all sub processes, because the 'child'
// process in this context is actually a cmd.exe wrapper.
taskKill();
callback();
return;
}
try {
// We are using the Windows Management Instrumentation Command-line
// (wmic.exe) to resolve the sub-child process identifier, because the
// 'child' process in this context is actually a cmd.exe wrapper.
// We want to send the termination signal directly to the node process.
// The '2> nul' silences the no process found error message.
const resultBuffer = execSync(
`wmic process where (ParentProcessId=${child.pid}) get ProcessId 2> nul`
);
const result = resultBuffer.toString().match(/^[0-9]+/m);
// If there is no sub-child process we fall back to the child process.
const processId = Array.isArray(result) ? result[0] : child.pid;
debug('sending kill signal SIGINT to process: %s', processId);
// We are using the standalone 'windows-kill' executable to send the
// standard POSIX signal 'SIGINT' to the node process. This fixes #1720.
const windowsKill = path.normalize(
`${__dirname}/../../bin/windows-kill.exe`
);
// We have to detach the 'windows-kill' execution completely from this
// process group to avoid terminating the nodemon process itself.
// See: https://github.com/alirdn/windows-kill#how-it-works--limitations
//
// Therefore we are using 'start' to create a new cmd.exe context.
// The '/min' option hides the new terminal window and the '/wait'
// option lets the process wait for the command to finish.
execSync(
`start "windows-kill" /min /wait "${windowsKill}" -SIGINT ${processId}`
);
} catch (e) {
taskKill();
}
callback();
} else {
// we use psTree to kill the full subtree of nodemon, because when
// spawning processes like `coffee` under the `--debug` flag, it'll spawn
// it's own child, and that can't be killed by nodemon, so psTree gives us
// an array of PIDs that have spawned under nodemon, and we send each the
// configured signal (default: SIGUSR2) signal, which fixes #335
// note that psTree also works if `ps` is missing by looking in /proc
let sig = signal.replace('SIG', '');
psTree(child.pid, function (err, pids) {
// if ps isn't native to the OS, then we need to send the numeric value
// for the signal during the kill, `signals` is a lookup table for that.
if (!psTree.hasPS) {
sig = signals[signal];
}
// the sub processes need to be killed from smallest to largest
debug('sending kill signal to ' + pids.join(', '));
child.kill(signal);
pids.sort().forEach((pid) => exec(`kill -${sig} ${pid}`, noop));
waitForSubProcesses(child.pid, () => {
// finally kill the main user process
exec(`kill -${sig} ${child.pid}`, callback);
});
});
}
}
run.kill = function (noRestart, callback) {
// I hate code like this :( - Remy (author of said code)
if (typeof noRestart === 'function') {
callback = noRestart;
noRestart = false;
}
if (!callback) {
callback = noop;
}
if (child !== null) {
// if the stdin piping is on, we need to unpipe, but also close stdin on
// the child, otherwise linux can throw EPIPE or ECONNRESET errors.
if (run.options.stdin) {
process.stdin.unpipe(child.stdin);
}
// For the on('exit', ...) handler above the following looks like a
// crash, so we set the killedAfterChange flag if a restart is planned
if (!noRestart) {
killedAfterChange = true;
}
/* Now kill the entire subtree of processes belonging to nodemon */
var oldPid = child.pid;
if (child) {
kill(child, config.signal, function () {
// this seems to fix the 0.11.x issue with the "rs" restart command,
// though I'm unsure why. it seems like more data is streamed in to
// stdin after we close.
if (child && run.options.stdin && child.stdin && oldPid === child.pid) {
child.stdin.end();
}
callback();
});
}
} else if (!noRestart) {
// if there's no child, then we need to manually start the process
// this is because as there was no child, the child.on('exit') event
// handler doesn't exist which would normally trigger the restart.
bus.once('start', callback);
run.restart();
} else {
callback();
}
};
run.restart = noop;
bus.on('quit', function onQuit(code) {
if (code === undefined) {
code = 0;
}
// remove event listener
var exitTimer = null;
var exit = function () {
clearTimeout(exitTimer);
exit = noop; // null out in case of race condition
child = null;
if (!config.required) {
// Execute all other quit listeners.
bus.listeners('quit').forEach(function (listener) {
if (listener !== onQuit) {
listener();
}
});
process.exit(code);
} else {
bus.emit('exit');
}
};
// if we're not running already, don't bother with trying to kill
if (config.run === false) {
return exit();
}
// immediately try to stop any polling
config.run = false;
if (child) {
// give up waiting for the kids after 10 seconds
exitTimer = setTimeout(exit, 10 * 1000);
child.removeAllListeners('exit');
child.once('exit', exit);
kill(child, 'SIGINT');
} else {
exit();
}
});
bus.on('restart', function () {
// run.kill will send a SIGINT to the child process, which will cause it
// to terminate, which in turn uses the 'exit' event handler to restart
run.kill();
});
// remove the child file on exit
process.on('exit', function () {
utils.log.detail('exiting');
if (child) {
child.kill();
}
});
// because windows borks when listening for the SIG* events
if (!utils.isWindows) {
bus.once('boot', () => {
// usual suspect: ctrl+c exit
process.once('SIGINT', () => bus.emit('quit', 130));
process.once('SIGTERM', () => {
bus.emit('quit', 143);
if (child) {
child.kill('SIGTERM');
}
});
});
}
module.exports = run;

34
node_modules/nodemon/lib/monitor/signals.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
module.exports = {
SIGHUP: 1,
SIGINT: 2,
SIGQUIT: 3,
SIGILL: 4,
SIGTRAP: 5,
SIGABRT: 6,
SIGBUS: 7,
SIGFPE: 8,
SIGKILL: 9,
SIGUSR1: 10,
SIGSEGV: 11,
SIGUSR2: 12,
SIGPIPE: 13,
SIGALRM: 14,
SIGTERM: 15,
SIGSTKFLT: 16,
SIGCHLD: 17,
SIGCONT: 18,
SIGSTOP: 19,
SIGTSTP: 20,
SIGTTIN: 21,
SIGTTOU: 22,
SIGURG: 23,
SIGXCPU: 24,
SIGXFSZ: 25,
SIGVTALRM: 26,
SIGPROF: 27,
SIGWINCH: 28,
SIGIO: 29,
SIGPWR: 30,
SIGSYS: 31,
SIGRTMIN: 35,
}

239
node_modules/nodemon/lib/monitor/watch.js generated vendored Normal file
View File

@@ -0,0 +1,239 @@
module.exports.watch = watch;
module.exports.resetWatchers = resetWatchers;
var debug = require('debug')('nodemon:watch');
var debugRoot = require('debug')('nodemon');
var chokidar = require('chokidar');
var undefsafe = require('undefsafe');
var config = require('../config');
var path = require('path');
var utils = require('../utils');
var bus = utils.bus;
var match = require('./match');
var watchers = [];
var debouncedBus;
bus.on('reset', resetWatchers);
function resetWatchers() {
debugRoot('resetting watchers');
watchers.forEach(function (watcher) {
watcher.close();
});
watchers = [];
}
function watch() {
if (watchers.length) {
debug('early exit on watch, still watching (%s)', watchers.length);
return;
}
var dirs = [].slice.call(config.dirs);
debugRoot('start watch on: %s', dirs.join(', '));
const rootIgnored = config.options.ignore;
debugRoot('ignored', rootIgnored);
var watchedFiles = [];
const promise = new Promise(function (resolve) {
const dotFilePattern = /[/\\]\./;
var ignored = match.rulesToMonitor(
[], // not needed
Array.from(rootIgnored),
config
).map(pattern => pattern.slice(1));
const addDotFile = dirs.filter(dir => dir.match(dotFilePattern));
// don't ignore dotfiles if explicitly watched.
if (addDotFile.length === 0) {
ignored.push(dotFilePattern);
}
var watchOptions = {
ignorePermissionErrors: true,
ignored: ignored,
persistent: true,
usePolling: config.options.legacyWatch || false,
interval: config.options.pollingInterval,
// note to future developer: I've gone back and forth on adding `cwd`
// to the props and in some cases it fixes bugs but typically it causes
// bugs elsewhere (since nodemon is used is so many ways). the final
// decision is to *not* use it at all and work around it
// cwd: ...
};
if (utils.isWindows) {
watchOptions.disableGlobbing = true;
}
if (process.env.TEST) {
watchOptions.useFsEvents = false;
}
var watcher = chokidar.watch(
dirs,
Object.assign({}, watchOptions, config.options.watchOptions || {})
);
watcher.ready = false;
var total = 0;
watcher.on('change', filterAndRestart);
watcher.on('add', function (file) {
if (watcher.ready) {
return filterAndRestart(file);
}
watchedFiles.push(file);
bus.emit('watching', file);
debug('chokidar watching: %s', file);
});
watcher.on('ready', function () {
watchedFiles = Array.from(new Set(watchedFiles)); // ensure no dupes
total = watchedFiles.length;
watcher.ready = true;
resolve(total);
debugRoot('watch is complete');
});
watcher.on('error', function (error) {
if (error.code === 'EINVAL') {
utils.log.error(
'Internal watch failed. Likely cause: too many ' +
'files being watched (perhaps from the root of a drive?\n' +
'See https://github.com/paulmillr/chokidar/issues/229 for details'
);
} else {
utils.log.error('Internal watch failed: ' + error.message);
process.exit(1);
}
});
watchers.push(watcher);
});
return promise.catch(e => {
// this is a core error and it should break nodemon - so I have to break
// out of a promise using the setTimeout
setTimeout(() => {
throw e;
});
}).then(function () {
utils.log.detail(`watching ${watchedFiles.length} file${
watchedFiles.length === 1 ? '' : 's'}`);
return watchedFiles;
});
}
function filterAndRestart(files) {
if (!Array.isArray(files)) {
files = [files];
}
if (files.length) {
var cwd = process.cwd();
if (this.options && this.options.cwd) {
cwd = this.options.cwd;
}
utils.log.detail(
'files triggering change check: ' +
files
.map(file => {
const res = path.relative(cwd, file);
return res;
})
.join(', ')
);
// make sure the path is right and drop an empty
// filenames (sometimes on windows)
files = files.filter(Boolean).map(file => {
return path.relative(process.cwd(), path.relative(cwd, file));
});
if (utils.isWindows) {
// ensure the drive letter is in uppercase (c:\foo -> C:\foo)
files = files.map(f => {
if (f.indexOf(':') === -1) { return f; }
return f[0].toUpperCase() + f.slice(1);
});
}
debug('filterAndRestart on', files);
var matched = match(
files,
config.options.monitor,
undefsafe(config, 'options.execOptions.ext')
);
debug('matched?', JSON.stringify(matched));
// if there's no matches, then test to see if the changed file is the
// running script, if so, let's allow a restart
if (config.options.execOptions && config.options.execOptions.script) {
const script = path.resolve(config.options.execOptions.script);
if (matched.result.length === 0 && script) {
const length = script.length;
files.find(file => {
if (file.substr(-length, length) === script) {
matched = {
result: [file],
total: 1,
};
return true;
}
});
}
}
utils.log.detail(
'changes after filters (before/after): ' +
[files.length, matched.result.length].join('/')
);
// reset the last check so we're only looking at recently modified files
config.lastStarted = Date.now();
if (matched.result.length) {
if (config.options.delay > 0) {
utils.log.detail('delaying restart for ' + config.options.delay + 'ms');
if (debouncedBus === undefined) {
debouncedBus = debounce(restartBus, config.options.delay);
}
debouncedBus(matched);
} else {
return restartBus(matched);
}
}
}
}
function restartBus(matched) {
utils.log.status('restarting due to changes...');
matched.result.map(file => {
utils.log.detail(path.relative(process.cwd(), file));
});
if (config.options.verbose) {
utils.log._log('');
}
bus.emit('restart', matched.result);
}
function debounce(fn, delay) {
var timer = null;
return function () {
const context = this;
const args = arguments;
clearTimeout(timer);
timer = setTimeout(() =>fn.apply(context, args), delay);
};
}

311
node_modules/nodemon/lib/nodemon.js generated vendored Normal file
View File

@@ -0,0 +1,311 @@
var debug = require('debug')('nodemon');
var path = require('path');
var monitor = require('./monitor');
var cli = require('./cli');
var version = require('./version');
var util = require('util');
var utils = require('./utils');
var bus = utils.bus;
var help = require('./help');
var config = require('./config');
var spawn = require('./spawn');
const defaults = require('./config/defaults')
var eventHandlers = {};
// this is fairly dirty, but theoretically sound since it's part of the
// stable module API
config.required = utils.isRequired;
function nodemon(settings) {
bus.emit('boot');
nodemon.reset();
// allow the cli string as the argument to nodemon, and allow for
// `node nodemon -V app.js` or just `-V app.js`
if (typeof settings === 'string') {
settings = settings.trim();
if (settings.indexOf('node') !== 0) {
if (settings.indexOf('nodemon') !== 0) {
settings = 'nodemon ' + settings;
}
settings = 'node ' + settings;
}
settings = cli.parse(settings);
}
// set the debug flag as early as possible to get all the detailed logging
if (settings.verbose) {
utils.debug = true;
}
if (settings.help) {
if (process.stdout.isTTY) {
process.stdout._handle.setBlocking(true); // nodejs/node#6456
}
console.log(help(settings.help));
if (!config.required) {
process.exit(0);
}
}
if (settings.version) {
version().then(function (v) {
console.log(v);
if (!config.required) {
process.exit(0);
}
});
return;
}
// nodemon tools like grunt-nodemon. This affects where
// the script is being run from, and will affect where
// nodemon looks for the nodemon.json files
if (settings.cwd) {
// this is protection to make sure we haven't dont the chdir already...
// say like in cli/parse.js (which is where we do this once already!)
if (process.cwd() !== path.resolve(config.system.cwd, settings.cwd)) {
process.chdir(settings.cwd);
}
}
const cwd = process.cwd();
config.load(settings, function (config) {
if (!config.options.dump && !config.options.execOptions.script &&
config.options.execOptions.exec === 'node') {
if (!config.required) {
console.log(help('usage'));
process.exit();
}
return;
}
// before we print anything, update the colour setting on logging
utils.colours = config.options.colours;
// always echo out the current version
utils.log.info(version.pinned);
const cwd = process.cwd();
if (config.options.cwd) {
utils.log.detail('process root: ' + cwd);
}
config.loaded.map(file => file.replace(cwd, '.')).forEach(file => {
utils.log.detail('reading config ' + file);
});
if (config.options.stdin && config.options.restartable) {
// allow nodemon to restart when the use types 'rs\n'
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', data => {
const str = data.toString().trim().toLowerCase();
// if the keys entered match the restartable value, then restart!
if (str === config.options.restartable) {
bus.emit('restart');
} else if (data.charCodeAt(0) === 12) { // ctrl+l
console.clear();
}
});
} else if (config.options.stdin) {
// so let's make sure we don't eat the key presses
// but also, since we're wrapping, watch out for
// special keys, like ctrl+c x 2 or '.exit' or ctrl+d or ctrl+l
var ctrlC = false;
var buffer = '';
process.stdin.on('data', function (data) {
data = data.toString();
buffer += data;
const chr = data.charCodeAt(0);
// if restartable, echo back
if (chr === 3) {
if (ctrlC) {
process.exit(0);
}
ctrlC = true;
return;
} else if (buffer === '.exit' || chr === 4) { // ctrl+d
process.exit();
} else if (chr === 13 || chr === 10) { // enter / carriage return
buffer = '';
} else if (chr === 12) { // ctrl+l
console.clear();
buffer = '';
}
ctrlC = false;
});
if (process.stdin.setRawMode) {
process.stdin.setRawMode(true);
}
}
if (config.options.restartable) {
utils.log.info('to restart at any time, enter `' +
config.options.restartable + '`');
}
if (!config.required) {
const restartSignal = config.options.signal === 'SIGUSR2' ? 'SIGHUP' : 'SIGUSR2';
process.on(restartSignal, nodemon.restart);
utils.bus.on('error', () => {
utils.log.fail((new Error().stack));
});
utils.log.detail((config.options.restartable ? 'or ' : '') + 'send ' +
restartSignal + ' to ' + process.pid + ' to restart');
}
const ignoring = config.options.monitor.map(function (rule) {
if (rule.slice(0, 1) !== '!') {
return false;
}
rule = rule.slice(1);
// don't notify of default ignores
if (defaults.ignoreRoot.indexOf(rule) !== -1) {
return false;
return rule.slice(3).slice(0, -3);
}
if (rule.startsWith(cwd)) {
return rule.replace(cwd, '.');
}
return rule;
}).filter(Boolean).join(' ');
if (ignoring) utils.log.detail('ignoring: ' + ignoring);
utils.log.info('watching path(s): ' + config.options.monitor.map(function (rule) {
if (rule.slice(0, 1) !== '!') {
try {
rule = path.relative(process.cwd(), rule);
} catch (e) {}
return rule;
}
return false;
}).filter(Boolean).join(' '));
utils.log.info('watching extensions: ' + (config.options.execOptions.ext || '(all)'));
if (config.options.dump) {
utils.log._log('log', '--------------');
utils.log._log('log', 'node: ' + process.version);
utils.log._log('log', 'nodemon: ' + version.pinned);
utils.log._log('log', 'command: ' + process.argv.join(' '));
utils.log._log('log', 'cwd: ' + cwd);
utils.log._log('log', ['OS:', process.platform, process.arch].join(' '));
utils.log._log('log', '--------------');
utils.log._log('log', util.inspect(config, { depth: null }));
utils.log._log('log', '--------------');
if (!config.required) {
process.exit();
}
return;
}
config.run = true;
if (config.options.stdout === false) {
nodemon.on('start', function () {
nodemon.stdout = bus.stdout;
nodemon.stderr = bus.stderr;
bus.emit('readable');
});
}
if (config.options.events && Object.keys(config.options.events).length) {
Object.keys(config.options.events).forEach(function (key) {
utils.log.detail('bind ' + key + ' -> `' +
config.options.events[key] + '`');
nodemon.on(key, function () {
if (config.options && config.options.events) {
spawn(config.options.events[key], config,
[].slice.apply(arguments));
}
});
});
}
monitor.run(config.options);
});
return nodemon;
}
nodemon.restart = function () {
utils.log.status('restarting child process');
bus.emit('restart');
return nodemon;
};
nodemon.addListener = nodemon.on = function (event, handler) {
if (!eventHandlers[event]) { eventHandlers[event] = []; }
eventHandlers[event].push(handler);
bus.on(event, handler);
return nodemon;
};
nodemon.once = function (event, handler) {
if (!eventHandlers[event]) { eventHandlers[event] = []; }
eventHandlers[event].push(handler);
bus.once(event, function () {
debug('bus.once(%s)', event);
eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1);
handler.apply(this, arguments);
});
return nodemon;
};
nodemon.emit = function () {
bus.emit.apply(bus, [].slice.call(arguments));
return nodemon;
};
nodemon.removeAllListeners = function (event) {
// unbind only the `nodemon.on` event handlers
Object.keys(eventHandlers).filter(function (e) {
return event ? e === event : true;
}).forEach(function (event) {
eventHandlers[event].forEach(function (handler) {
bus.removeListener(event, handler);
eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1);
});
});
return nodemon;
};
nodemon.reset = function (done) {
bus.emit('reset', done);
};
bus.on('reset', function (done) {
debug('reset');
nodemon.removeAllListeners();
monitor.run.kill(true, function () {
utils.reset();
config.reset();
config.run = false;
if (done) {
done();
}
});
});
// expose the full config
nodemon.config = config;
module.exports = nodemon;

89
node_modules/nodemon/lib/rules/add.js generated vendored Normal file
View File

@@ -0,0 +1,89 @@
'use strict';
var utils = require('../utils');
// internal
var reEscComments = /\\#/g;
// note that '^^' is used in place of escaped comments
var reUnescapeComments = /\^\^/g;
var reComments = /#.*$/;
var reEscapeChars = /[.|\-[\]()\\]/g;
var reAsterisk = /\*/g;
module.exports = add;
/**
* Converts file patterns or regular expressions to nodemon
* compatible RegExp matching rules. Note: the `rules` argument
* object is modified to include the new rule and new RegExp
*
* ### Example:
*
* var rules = { watch: [], ignore: [] };
* add(rules, 'watch', '*.js');
* add(rules, 'ignore', '/public/');
* add(rules, 'watch', ':(\d)*\.js'); // note: string based regexp
* add(rules, 'watch', /\d*\.js/);
*
* @param {Object} rules containing `watch` and `ignore`. Also updated during
* execution
* @param {String} which must be either "watch" or "ignore"
* @param {String|RegExp} the actual rule.
*/
function add(rules, which, rule) {
if (!{ ignore: 1, watch: 1}[which]) {
throw new Error('rules/index.js#add requires "ignore" or "watch" as the ' +
'first argument');
}
if (Array.isArray(rule)) {
rule.forEach(function (rule) {
add(rules, which, rule);
});
return;
}
// support the rule being a RegExp, but reformat it to
// the custom :<regexp> format that we're working with.
if (rule instanceof RegExp) {
// rule = ':' + rule.toString().replace(/^\/(.*?)\/$/g, '$1');
utils.log.error('RegExp format no longer supported, but globs are.');
return;
}
// remove comments and trim lines
// this mess of replace methods is escaping "\#" to allow for emacs temp files
// first up strip comments and remove blank head or tails
rule = (rule || '').replace(reEscComments, '^^')
.replace(reComments, '')
.replace(reUnescapeComments, '#').trim();
var regexp = false;
if (typeof rule === 'string' && rule.substring(0, 1) === ':') {
rule = rule.substring(1);
utils.log.error('RegExp no longer supported: ' + rule);
regexp = true;
} else if (rule.length === 0) {
// blank line (or it was a comment)
return;
}
if (regexp) {
// rules[which].push(rule);
} else {
// rule = rule.replace(reEscapeChars, '\\$&')
// .replace(reAsterisk, '.*');
rules[which].push(rule);
// compile a regexp of all the rules for this ignore or watch
var re = rules[which].map(function (rule) {
return rule.replace(reEscapeChars, '\\$&')
.replace(reAsterisk, '.*');
}).join('|');
// used for the directory matching
rules[which].re = new RegExp(re);
}
}

53
node_modules/nodemon/lib/rules/index.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
'use strict';
var utils = require('../utils');
var add = require('./add');
var parse = require('./parse');
// exported
var rules = { ignore: [], watch: [] };
/**
* Loads a nodemon config file and populates the ignore
* and watch rules with it's contents, and calls callback
* with the new rules
*
* @param {String} filename
* @param {Function} callback
*/
function load(filename, callback) {
parse(filename, function (err, result) {
if (err) {
// we should have bombed already, but
utils.log.error(err);
callback(err);
}
if (result.raw) {
result.raw.forEach(add.bind(null, rules, 'ignore'));
} else {
result.ignore.forEach(add.bind(null, rules, 'ignore'));
result.watch.forEach(add.bind(null, rules, 'watch'));
}
callback(null, rules);
});
}
module.exports = {
reset: function () { // just used for testing
rules.ignore.length = rules.watch.length = 0;
delete rules.ignore.re;
delete rules.watch.re;
},
load: load,
ignore: {
test: add.bind(null, rules, 'ignore'),
add: add.bind(null, rules, 'ignore'),
},
watch: {
test: add.bind(null, rules, 'watch'),
add: add.bind(null, rules, 'watch'),
},
add: add.bind(null, rules),
rules: rules,
};

43
node_modules/nodemon/lib/rules/parse.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
'use strict';
var fs = require('fs');
/**
* Parse the nodemon config file, supporting both old style
* plain text config file, and JSON version of the config
*
* @param {String} filename
* @param {Function} callback
*/
function parse(filename, callback) {
var rules = {
ignore: [],
watch: [],
};
fs.readFile(filename, 'utf8', function (err, content) {
if (err) {
return callback(err);
}
var json = null;
try {
json = JSON.parse(content);
} catch (e) {}
if (json !== null) {
rules = {
ignore: json.ignore || [],
watch: json.watch || [],
};
return callback(null, rules);
}
// otherwise return the raw file
return callback(null, { raw: content.split(/\n/) });
});
}
module.exports = parse;

74
node_modules/nodemon/lib/spawn.js generated vendored Normal file
View File

@@ -0,0 +1,74 @@
const path = require('path');
const utils = require('./utils');
const merge = utils.merge;
const bus = utils.bus;
const spawn = require('child_process').spawn;
module.exports = function spawnCommand(command, config, eventArgs) {
var stdio = ['pipe', 'pipe', 'pipe'];
if (config.options.stdout) {
stdio = ['pipe', process.stdout, process.stderr];
}
const env = merge(process.env, { FILENAME: eventArgs[0] });
var sh = 'sh';
var shFlag = '-c';
var spawnOptions = {
env: merge(config.options.execOptions.env, env),
stdio: stdio,
};
if (!Array.isArray(command)) {
command = [command];
}
if (utils.isWindows) {
// if the exec includes a forward slash, reverse it for windows compat
// but *only* apply to the first command, and none of the arguments.
// ref #1251 and #1236
command = command.map(executable => {
if (executable.indexOf('/') === -1) {
return executable;
}
return executable.split(' ').map((e, i) => {
if (i === 0) {
return path.normalize(e);
}
return e;
}).join(' ');
});
// taken from npm's cli: https://git.io/vNFD4
sh = process.env.comspec || 'cmd';
shFlag = '/d /s /c';
spawnOptions.windowsVerbatimArguments = true;
spawnOptions.windowsHide = true;
}
const args = command.join(' ');
const child = spawn(sh, [shFlag, args], spawnOptions);
if (config.required) {
var emit = {
stdout: function (data) {
bus.emit('stdout', data);
},
stderr: function (data) {
bus.emit('stderr', data);
},
};
// now work out what to bind to...
if (config.options.stdout) {
child.on('stdout', emit.stdout).on('stderr', emit.stderr);
} else {
child.stdout.on('data', emit.stdout);
child.stderr.on('data', emit.stderr);
bus.stdout = child.stdout;
bus.stderr = child.stderr;
}
}
};

44
node_modules/nodemon/lib/utils/bus.js generated vendored Normal file
View File

@@ -0,0 +1,44 @@
var events = require('events');
var debug = require('debug')('nodemon');
var util = require('util');
var Bus = function () {
events.EventEmitter.call(this);
};
util.inherits(Bus, events.EventEmitter);
var bus = new Bus();
// /*
var collected = {};
bus.on('newListener', function (event) {
debug('bus new listener: %s (%s)', event, bus.listeners(event).length);
if (!collected[event]) {
collected[event] = true;
bus.on(event, function () {
debug('bus emit: %s', event);
});
}
});
// */
// proxy process messages (if forked) to the bus
process.on('message', function (event) {
debug('process.message(%s)', event);
bus.emit(event);
});
var emit = bus.emit;
// if nodemon was spawned via a fork, allow upstream communication
// via process.send
if (process.send) {
bus.emit = function (event, data) {
process.send({ type: event, data: data });
emit.apply(bus, arguments);
};
}
module.exports = bus;

40
node_modules/nodemon/lib/utils/clone.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
module.exports = clone;
// via http://stackoverflow.com/a/728694/22617
function clone(obj) {
// Handle the 3 simple types, and null or undefined
if (null === obj || 'object' !== typeof obj) {
return obj;
}
var copy;
// Handle Date
if (obj instanceof Date) {
copy = new Date();
copy.setTime(obj.getTime());
return copy;
}
// Handle Array
if (obj instanceof Array) {
copy = [];
for (var i = 0, len = obj.length; i < len; i++) {
copy[i] = clone(obj[i]);
}
return copy;
}
// Handle Object
if (obj instanceof Object) {
copy = {};
for (var attr in obj) {
if (obj.hasOwnProperty && obj.hasOwnProperty(attr)) {
copy[attr] = clone(obj[attr]);
}
}
return copy;
}
throw new Error('Unable to copy obj! Its type isn\'t supported.');
}

26
node_modules/nodemon/lib/utils/colour.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
/**
* Encodes a string in a colour: red, yellow or green
* @param {String} c colour to highlight in
* @param {String} str the string to encode
* @return {String} coloured string for terminal printing
*/
function colour(c, str) {
return (colour[c] || colour.black) + str + colour.black;
}
function strip(str) {
re.lastIndex = 0; // reset position
return str.replace(re, '');
}
colour.red = '\x1B[31m';
colour.yellow = '\x1B[33m';
colour.green = '\x1B[32m';
colour.black = '\x1B[39m';
var reStr = Object.keys(colour).map(key => colour[key]).join('|');
var re = new RegExp(('(' + reStr + ')').replace(/\[/g, '\\['), 'g');
colour.strip = strip;
module.exports = colour;

102
node_modules/nodemon/lib/utils/index.js generated vendored Normal file
View File

@@ -0,0 +1,102 @@
var noop = function () { };
var path = require('path');
const semver = require('semver');
var version = process.versions.node.split('.') || [null, null, null];
var utils = (module.exports = {
semver: semver,
satisfies: test => semver.satisfies(process.versions.node, test),
version: {
major: parseInt(version[0] || 0, 10),
minor: parseInt(version[1] || 0, 10),
patch: parseInt(version[2] || 0, 10),
},
clone: require('./clone'),
merge: require('./merge'),
bus: require('./bus'),
isWindows: process.platform === 'win32',
isMac: process.platform === 'darwin',
isLinux: process.platform === 'linux',
isRequired: (function () {
var p = module.parent;
while (p) {
// in electron.js engine it happens
if (!p.filename) {
return true;
}
if (p.filename.indexOf('bin' + path.sep + 'nodemon.js') !== -1) {
return false;
}
p = p.parent;
}
return true;
})(),
home: process.env.HOME || process.env.HOMEPATH,
quiet: function () {
// nukes the logging
if (!this.debug) {
for (var method in utils.log) {
if (typeof utils.log[method] === 'function') {
utils.log[method] = noop;
}
}
}
},
reset: function () {
if (!this.debug) {
for (var method in utils.log) {
if (typeof utils.log[method] === 'function') {
delete utils.log[method];
}
}
}
this.debug = false;
},
regexpToText: function (t) {
return t
.replace(/\.\*\\./g, '*.')
.replace(/\\{2}/g, '^^')
.replace(/\\/g, '')
.replace(/\^\^/g, '\\');
},
stringify: function (exec, args) {
// serializes an executable string and array of arguments into a string
args = args || [];
return [exec]
.concat(
args.map(function (arg) {
// if an argument contains a space, we want to show it with quotes
// around it to indicate that it is a single argument
if (arg.length > 0 && arg.indexOf(' ') === -1) {
return arg;
}
// this should correctly escape nested quotes
return JSON.stringify(arg);
})
)
.join(' ')
.trim();
},
});
utils.log = require('./log')(utils.isRequired);
Object.defineProperty(utils, 'debug', {
set: function (value) {
this.log.debug = value;
},
get: function () {
return this.log.debug;
},
});
Object.defineProperty(utils, 'colours', {
set: function (value) {
this.log.useColours = value;
},
get: function () {
return this.log.useColours;
},
});

82
node_modules/nodemon/lib/utils/log.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
var colour = require('./colour');
var bus = require('./bus');
var required = false;
var useColours = true;
var coding = {
log: 'black',
info: 'yellow',
status: 'green',
detail: 'yellow',
fail: 'red',
error: 'red',
};
function log(type, text) {
var msg = '[nodemon] ' + (text || '');
if (useColours) {
msg = colour(coding[type], msg);
}
// always push the message through our bus, using nextTick
// to help testing and get _out of_ promises.
process.nextTick(() => {
bus.emit('log', { type: type, message: text, colour: msg });
});
// but if we're running on the command line, also echo out
// question: should we actually just consume our own events?
if (!required) {
if (type === 'error') {
console.error(msg);
} else {
console.log(msg || '');
}
}
}
var Logger = function (r) {
if (!(this instanceof Logger)) {
return new Logger(r);
}
this.required(r);
return this;
};
Object.keys(coding).forEach(function (type) {
Logger.prototype[type] = log.bind(null, type);
});
// detail is for messages that are turned on during debug
Logger.prototype.detail = function (msg) {
if (this.debug) {
log('detail', msg);
}
};
Logger.prototype.required = function (val) {
required = val;
};
Logger.prototype.debug = false;
Logger.prototype._log = function (type, msg) {
if (required) {
bus.emit('log', { type: type, message: msg || '', colour: msg || '' });
} else if (type === 'error') {
console.error(msg);
} else {
console.log(msg || '');
}
};
Object.defineProperty(Logger.prototype, 'useColours', {
set: function (val) {
useColours = val;
},
get: function () {
return useColours;
},
});
module.exports = Logger;

47
node_modules/nodemon/lib/utils/merge.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
var clone = require('./clone');
module.exports = merge;
function typesMatch(a, b) {
return (typeof a === typeof b) && (Array.isArray(a) === Array.isArray(b));
}
/**
* A deep merge of the source based on the target.
* @param {Object} source [description]
* @param {Object} target [description]
* @return {Object} [description]
*/
function merge(source, target, result) {
if (result === undefined) {
result = clone(source);
}
// merge missing values from the target to the source
Object.getOwnPropertyNames(target).forEach(function (key) {
if (source[key] === undefined) {
result[key] = target[key];
}
});
Object.getOwnPropertyNames(source).forEach(function (key) {
var value = source[key];
if (target[key] && typesMatch(value, target[key])) {
// merge empty values
if (value === '') {
result[key] = target[key];
}
if (Array.isArray(value)) {
if (value.length === 0 && target[key].length) {
result[key] = target[key].slice(0);
}
} else if (typeof value === 'object') {
result[key] = merge(value, target[key]);
}
}
});
return result;
}

100
node_modules/nodemon/lib/version.js generated vendored Normal file
View File

@@ -0,0 +1,100 @@
module.exports = version;
module.exports.pin = pin;
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
var root = null;
function pin() {
return version().then(function (v) {
version.pinned = v;
});
}
function version(callback) {
// first find the package.json as this will be our root
var promise = findPackage(path.dirname(module.parent.filename))
.then(function (dir) {
// now try to load the package
var v = require(path.resolve(dir, 'package.json')).version;
if (v && v !== '0.0.0-development') {
return v;
}
root = dir;
// else we're in development, give the commit out
// get the last commit and whether the working dir is dirty
var promises = [
branch().catch(function () { return 'master'; }),
commit().catch(function () { return '<none>'; }),
dirty().catch(function () { return 0; }),
];
// use the cached result as the export
return Promise.all(promises).then(function (res) {
var branch = res[0];
var commit = res[1];
var dirtyCount = parseInt(res[2], 10);
var curr = branch + ': ' + commit;
if (dirtyCount !== 0) {
curr += ' (' + dirtyCount + ' dirty files)';
}
return curr;
});
}).catch(function (error) {
console.log(error.stack);
throw error;
});
if (callback) {
promise.then(function (res) {
callback(null, res);
}, callback);
}
return promise;
}
function findPackage(dir) {
if (dir === '/') {
return Promise.reject(new Error('package not found'));
}
return new Promise(function (resolve) {
fs.stat(path.resolve(dir, 'package.json'), function (error, exists) {
if (error || !exists) {
return resolve(findPackage(path.resolve(dir, '..')));
}
resolve(dir);
});
});
}
function command(cmd) {
return new Promise(function (resolve, reject) {
exec(cmd, { cwd: root }, function (err, stdout, stderr) {
var error = stderr.trim();
if (error) {
return reject(new Error(error));
}
resolve(stdout.split('\n').join(''));
});
});
}
function commit() {
return command('git rev-parse HEAD');
}
function branch() {
return command('git rev-parse --abbrev-ref HEAD');
}
function dirty() {
return command('expr $(git status --porcelain 2>/dev/null| ' +
'egrep "^(M| M)" | wc -l)');
}

16
node_modules/nodemon/node_modules/.bin/semver generated vendored Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../semver/bin/semver" "$@"
else
exec node "$basedir/../semver/bin/semver" "$@"
fi

17
node_modules/nodemon/node_modules/.bin/semver.cmd generated vendored Normal file
View File

@@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver" %*

28
node_modules/nodemon/node_modules/.bin/semver.ps1 generated vendored Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
} else {
& "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../semver/bin/semver" $args
} else {
& "node$exe" "$basedir/../semver/bin/semver" $args
}
$ret=$LASTEXITCODE
}
exit $ret

8
node_modules/nodemon/node_modules/has-flag/index.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
'use strict';
module.exports = (flag, argv) => {
argv = argv || process.argv;
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
const pos = argv.indexOf(prefix + flag);
const terminatorPos = argv.indexOf('--');
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
};

9
node_modules/nodemon/node_modules/has-flag/license generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,44 @@
{
"name": "has-flag",
"version": "3.0.0",
"description": "Check if argv has a specific flag",
"license": "MIT",
"repository": "sindresorhus/has-flag",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"has",
"check",
"detect",
"contains",
"find",
"flag",
"cli",
"command-line",
"argv",
"process",
"arg",
"args",
"argument",
"arguments",
"getopt",
"minimist",
"optimist"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
}

70
node_modules/nodemon/node_modules/has-flag/readme.md generated vendored Normal file
View File

@@ -0,0 +1,70 @@
# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)
> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
Correctly stops looking after an `--` argument terminator.
## Install
```
$ npm install has-flag
```
## Usage
```js
// foo.js
const hasFlag = require('has-flag');
hasFlag('unicorn');
//=> true
hasFlag('--unicorn');
//=> true
hasFlag('f');
//=> true
hasFlag('-f');
//=> true
hasFlag('foo=bar');
//=> true
hasFlag('foo');
//=> false
hasFlag('rainbow');
//=> false
```
```
$ node foo.js -f --unicorn --foo=bar -- --rainbow
```
## API
### hasFlag(flag, [argv])
Returns a boolean for whether the flag exists.
#### flag
Type: `string`
CLI flag to look for. The `--` prefix is optional.
#### argv
Type: `string[]`<br>
Default: `process.argv`
CLI arguments.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

15
node_modules/nodemon/node_modules/semver/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,15 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

412
node_modules/nodemon/node_modules/semver/README.md generated vendored Normal file
View File

@@ -0,0 +1,412 @@
semver(1) -- The semantic versioner for npm
===========================================
## Install
```bash
npm install --save semver
````
## Usage
As a node module:
```js
const semver = require('semver')
semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
semver.clean(' =v1.2.3 ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
semver.minVersion('>=1.0.0') // '1.0.0'
semver.valid(semver.coerce('v2')) // '2.0.0'
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
```
As a command-line utility:
```
$ semver -h
A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter
Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence
Options:
-r --range <range>
Print versions that match the specified range.
-i --increment [<level>]
Increment a version by the specified level. Level can
be one of: major, minor, patch, premajor, preminor,
prepatch, or prerelease. Default level is 'patch'.
Only one version may be specified.
--preid <identifier>
Identifier to be used to prefix premajor, preminor,
prepatch or prerelease version increments.
-l --loose
Interpret versions and ranges loosely
-p --include-prerelease
Always include prerelease versions in range matching
-c --coerce
Coerce a string into SemVer if possible
(does not imply --loose)
Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.
If no satisfying versions are found, then exits failure.
Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.
```
## Versions
A "version" is described by the `v2.0.0` specification found at
<https://semver.org/>.
A leading `"="` or `"v"` character is stripped off and ignored.
## Ranges
A `version range` is a set of `comparators` which specify versions
that satisfy the range.
A `comparator` is composed of an `operator` and a `version`. The set
of primitive `operators` is:
* `<` Less than
* `<=` Less than or equal to
* `>` Greater than
* `>=` Greater than or equal to
* `=` Equal. If no operator is specified, then equality is assumed,
so this operator is optional, but MAY be included.
For example, the comparator `>=1.2.7` would match the versions
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
or `1.1.0`.
Comparators can be joined by whitespace to form a `comparator set`,
which is satisfied by the **intersection** of all of the comparators
it includes.
A range is composed of one or more comparator sets, joined by `||`. A
version matches a range if and only if every comparator in at least
one of the `||`-separated comparator sets is satisfied by the version.
For example, the range `>=1.2.7 <1.3.0` would match the versions
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
or `1.1.0`.
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
### Prerelease Tags
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
it will only be allowed to satisfy comparator sets if at least one
comparator with the same `[major, minor, patch]` tuple also has a
prerelease tag.
For example, the range `>1.2.3-alpha.3` would be allowed to match the
version `1.2.3-alpha.7`, but it would *not* be satisfied by
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
range only accepts prerelease tags on the `1.2.3` version. The
version `3.4.5` *would* satisfy the range, because it does not have a
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
The purpose for this behavior is twofold. First, prerelease versions
frequently are updated very quickly, and contain many breaking changes
that are (by the author's design) not yet fit for public consumption.
Therefore, by default, they are excluded from range matching
semantics.
Second, a user who has opted into using a prerelease version has
clearly indicated the intent to use *that specific* set of
alpha/beta/rc versions. By including a prerelease tag in the range,
the user is indicating that they are aware of the risk. However, it
is still not appropriate to assume that they have opted into taking a
similar risk on the *next* set of prerelease versions.
Note that this behavior can be suppressed (treating all prerelease
versions as if they were normal versions, for the purpose of range
matching) by setting the `includePrerelease` flag on the options
object to any
[functions](https://github.com/npm/node-semver#functions) that do
range matching.
#### Prerelease Identifiers
The method `.inc` takes an additional `identifier` string argument that
will append the value of the string as a prerelease identifier:
```javascript
semver.inc('1.2.3', 'prerelease', 'beta')
// '1.2.4-beta.0'
```
command-line example:
```bash
$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
```
Which then can be used to increment further:
```bash
$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
```
### Advanced Range Syntax
Advanced range syntax desugars to primitive comparators in
deterministic ways.
Advanced ranges may be combined in the same way as primitive
comparators using white space or `||`.
#### Hyphen Ranges `X.Y.Z - A.B.C`
Specifies an inclusive set.
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
If a partial version is provided as the first version in the inclusive
range, then the missing pieces are replaced with zeroes.
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
If a partial version is provided as the second version in the
inclusive range, then all versions that start with the supplied parts
of the tuple are accepted, but nothing that would be greater than the
provided tuple parts.
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
numeric values in the `[major, minor, patch]` tuple.
* `*` := `>=0.0.0` (Any version satisfies)
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
A partial version range is treated as an X-Range, so the special
character is in fact optional.
* `""` (empty string) := `*` := `>=0.0.0`
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
Allows patch-level changes if a minor version is specified on the
comparator. Allows minor-level changes if not.
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
Allows changes that do not modify the left-most non-zero digit in the
`[major, minor, patch]` tuple. In other words, this allows patch and
minor updates for versions `1.0.0` and above, patch updates for
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
Many authors treat a `0.x` version as if the `x` were the major
"breaking-change" indicator.
Caret ranges are ideal when an author may make breaking changes
between `0.2.4` and `0.3.0` releases, which is a common practice.
However, it presumes that there will *not* be breaking changes between
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
additive (but non-breaking), according to commonly observed practices.
* `^1.2.3` := `>=1.2.3 <2.0.0`
* `^0.2.3` := `>=0.2.3 <0.3.0`
* `^0.0.3` := `>=0.0.3 <0.0.4`
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
`0.0.3` version *only* will be allowed, if they are greater than or
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
When parsing caret ranges, a missing `patch` value desugars to the
number `0`, but will allow flexibility within that value, even if the
major and minor versions are both `0`.
* `^1.2.x` := `>=1.2.0 <2.0.0`
* `^0.0.x` := `>=0.0.0 <0.1.0`
* `^0.0` := `>=0.0.0 <0.1.0`
A missing `minor` and `patch` values will desugar to zero, but also
allow flexibility within those values, even if the major version is
zero.
* `^1.x` := `>=1.0.0 <2.0.0`
* `^0.x` := `>=0.0.0 <1.0.0`
### Range Grammar
Putting all this together, here is a Backus-Naur grammar for ranges,
for the benefit of parser authors:
```bnf
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+
```
## Functions
All methods and classes take a final `options` object argument. All
options in this object are `false` by default. The options supported
are:
- `loose` Be more forgiving about not-quite-valid semver strings.
(Any resulting output will always be 100% strict compliant, of
course.) For backwards compatibility reasons, if the `options`
argument is a boolean value instead of an object, it is interpreted
to be the `loose` param.
- `includePrerelease` Set to suppress the [default
behavior](https://github.com/npm/node-semver#prerelease-tags) of
excluding prerelease tagged versions from ranges unless they are
explicitly opted into.
Strict-mode Comparators and Ranges will be strict about the SemVer
strings that they parse.
* `valid(v)`: Return the parsed version, or null if it's not valid.
* `inc(v, release)`: Return the version incremented by the release
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
`prepatch`, or `prerelease`), or null if it's not valid
* `premajor` in one call will bump the version up to the next major
version and down to a prerelease of that major version.
`preminor`, and `prepatch` work the same way.
* If called from a non-prerelease version, the `prerelease` will work the
same as `prepatch`. It increments the patch version, then makes a
prerelease. If the input version is already a prerelease it simply
increments it.
* `prerelease(v)`: Returns an array of prerelease components, or null
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
* `major(v)`: Return the major version number.
* `minor(v)`: Return the minor version number.
* `patch(v)`: Return the patch version number.
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
or comparators intersect.
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
a `SemVer` object or `null`.
### Comparison
* `gt(v1, v2)`: `v1 > v2`
* `gte(v1, v2)`: `v1 >= v2`
* `lt(v1, v2)`: `v1 < v2`
* `lte(v1, v2)`: `v1 <= v2`
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
even if they're not the exact same string. You already know how to
compare strings.
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
the corresponding function above. `"==="` and `"!=="` do simple
string comparison, but are included for completeness. Throws if an
invalid comparison string is provided.
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
in descending order when passed to `Array.sort()`.
* `diff(v1, v2)`: Returns difference between two versions by the release type
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
or null if the versions are the same.
### Comparators
* `intersects(comparator)`: Return true if the comparators intersect
### Ranges
* `validRange(range)`: Return the valid range or null if it's not valid
* `satisfies(version, range)`: Return true if the version satisfies the
range.
* `maxSatisfying(versions, range)`: Return the highest version in the list
that satisfies the range, or `null` if none of them do.
* `minSatisfying(versions, range)`: Return the lowest version in the list
that satisfies the range, or `null` if none of them do.
* `minVersion(range)`: Return the lowest version that can possibly match
the given range.
* `gtr(version, range)`: Return `true` if version is greater than all the
versions possible in the range.
* `ltr(version, range)`: Return `true` if version is less than all the
versions possible in the range.
* `outside(version, range, hilo)`: Return true if the version is outside
the bounds of the range in either the high or low direction. The
`hilo` argument must be either the string `'>'` or `'<'`. (This is
the function called by `gtr` and `ltr`.)
* `intersects(range)`: Return true if any of the ranges comparators intersect
Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, *or* satisfy a range! For
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
until `2.0.0`, so the version `1.2.10` would not be greater than the
range (because `2.0.1` satisfies, which is higher), nor less than the
range (since `1.2.8` satisfies, which is lower), and it also does not
satisfy the range.
If you want to know if a version satisfies or does not satisfy a
range, use the `satisfies(version, range)` function.
### Coercion
* `coerce(version)`: Coerces a string to semver if possible
This aims to provide a very forgiving translation of a non-semver string to
semver. It looks for the first digit in a string, and consumes all
remaining characters which satisfy at least a partial semver (e.g., `1`,
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
is not valid). The maximum length for any semver component considered for
coercion is 16 characters; longer components will be ignored
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
components are invalid (`9999999999999999.4.7.4` is likely invalid).

160
node_modules/nodemon/node_modules/semver/bin/semver generated vendored Normal file
View File

@@ -0,0 +1,160 @@
#!/usr/bin/env node
// Standalone semver comparison program.
// Exits successfully and prints matching version(s) if
// any supplied version is valid and passes all tests.
var argv = process.argv.slice(2)
var versions = []
var range = []
var inc = null
var version = require('../package.json').version
var loose = false
var includePrerelease = false
var coerce = false
var identifier
var semver = require('../semver')
var reverse = false
var options = {}
main()
function main () {
if (!argv.length) return help()
while (argv.length) {
var a = argv.shift()
var indexOfEqualSign = a.indexOf('=')
if (indexOfEqualSign !== -1) {
a = a.slice(0, indexOfEqualSign)
argv.unshift(a.slice(indexOfEqualSign + 1))
}
switch (a) {
case '-rv': case '-rev': case '--rev': case '--reverse':
reverse = true
break
case '-l': case '--loose':
loose = true
break
case '-p': case '--include-prerelease':
includePrerelease = true
break
case '-v': case '--version':
versions.push(argv.shift())
break
case '-i': case '--inc': case '--increment':
switch (argv[0]) {
case 'major': case 'minor': case 'patch': case 'prerelease':
case 'premajor': case 'preminor': case 'prepatch':
inc = argv.shift()
break
default:
inc = 'patch'
break
}
break
case '--preid':
identifier = argv.shift()
break
case '-r': case '--range':
range.push(argv.shift())
break
case '-c': case '--coerce':
coerce = true
break
case '-h': case '--help': case '-?':
return help()
default:
versions.push(a)
break
}
}
var options = { loose: loose, includePrerelease: includePrerelease }
versions = versions.map(function (v) {
return coerce ? (semver.coerce(v) || { version: v }).version : v
}).filter(function (v) {
return semver.valid(v)
})
if (!versions.length) return fail()
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
for (var i = 0, l = range.length; i < l; i++) {
versions = versions.filter(function (v) {
return semver.satisfies(v, range[i], options)
})
if (!versions.length) return fail()
}
return success(versions)
}
function failInc () {
console.error('--inc can only be used on a single version with no range')
fail()
}
function fail () { process.exit(1) }
function success () {
var compare = reverse ? 'rcompare' : 'compare'
versions.sort(function (a, b) {
return semver[compare](a, b, options)
}).map(function (v) {
return semver.clean(v, options)
}).map(function (v) {
return inc ? semver.inc(v, inc, options, identifier) : v
}).forEach(function (v, i, _) { console.log(v) })
}
function help () {
console.log(['SemVer ' + version,
'',
'A JavaScript implementation of the https://semver.org/ specification',
'Copyright Isaac Z. Schlueter',
'',
'Usage: semver [options] <version> [<version> [...]]',
'Prints valid versions sorted by SemVer precedence',
'',
'Options:',
'-r --range <range>',
' Print versions that match the specified range.',
'',
'-i --increment [<level>]',
' Increment a version by the specified level. Level can',
' be one of: major, minor, patch, premajor, preminor,',
" prepatch, or prerelease. Default level is 'patch'.",
' Only one version may be specified.',
'',
'--preid <identifier>',
' Identifier to be used to prefix premajor, preminor,',
' prepatch or prerelease version increments.',
'',
'-l --loose',
' Interpret versions and ranges loosely',
'',
'-p --include-prerelease',
' Always include prerelease versions in range matching',
'',
'-c --coerce',
' Coerce a string into SemVer if possible',
' (does not imply --loose)',
'',
'Program exits successfully if any valid version satisfies',
'all supplied ranges, and prints all satisfying versions.',
'',
'If no satisfying versions are found, then exits failure.',
'',
'Versions are printed in ascending order, so supplying',
'multiple versions to the utility will just sort them.'
].join('\n'))
}

38
node_modules/nodemon/node_modules/semver/package.json generated vendored Normal file
View File

@@ -0,0 +1,38 @@
{
"name": "semver",
"version": "5.7.2",
"description": "The semantic version parser used by npm.",
"main": "semver.js",
"scripts": {
"test": "tap test/ --100 --timeout=30",
"lint": "echo linting disabled",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"snap": "tap test/ --100 --timeout=30",
"posttest": "npm run lint"
},
"devDependencies": {
"@npmcli/template-oss": "4.17.0",
"tap": "^12.7.0"
},
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/npm/node-semver.git"
},
"bin": {
"semver": "./bin/semver"
},
"files": [
"bin",
"range.bnf",
"semver.js"
],
"author": "GitHub Inc.",
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"content": "./scripts/template-oss",
"version": "4.17.0"
}
}

16
node_modules/nodemon/node_modules/semver/range.bnf generated vendored Normal file
View File

@@ -0,0 +1,16 @@
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | [1-9] ( [0-9] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+

1525
node_modules/nodemon/node_modules/semver/semver.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
'use strict';
module.exports = {
stdout: false,
stderr: false
};

View File

@@ -0,0 +1,131 @@
'use strict';
const os = require('os');
const hasFlag = require('has-flag');
const env = process.env;
let forceColor;
if (hasFlag('no-color') ||
hasFlag('no-colors') ||
hasFlag('color=false')) {
forceColor = false;
} else if (hasFlag('color') ||
hasFlag('colors') ||
hasFlag('color=true') ||
hasFlag('color=always')) {
forceColor = true;
}
if ('FORCE_COLOR' in env) {
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
}
function translateLevel(level) {
if (level === 0) {
return false;
}
return {
level,
hasBasic: true,
has256: level >= 2,
has16m: level >= 3
};
}
function supportsColor(stream) {
if (forceColor === false) {
return 0;
}
if (hasFlag('color=16m') ||
hasFlag('color=full') ||
hasFlag('color=truecolor')) {
return 3;
}
if (hasFlag('color=256')) {
return 2;
}
if (stream && !stream.isTTY && forceColor !== true) {
return 0;
}
const min = forceColor ? 1 : 0;
if (process.platform === 'win32') {
// Node.js 7.5.0 is the first version of Node.js to include a patch to
// libuv that enables 256 color output on Windows. Anything earlier and it
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
// release that supports 256 colors. Windows 10 build 14931 is the first release
// that supports 16m/TrueColor.
const osRelease = os.release().split('.');
if (
Number(process.versions.node.split('.')[0]) >= 8 &&
Number(osRelease[0]) >= 10 &&
Number(osRelease[2]) >= 10586
) {
return Number(osRelease[2]) >= 14931 ? 3 : 2;
}
return 1;
}
if ('CI' in env) {
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
return 1;
}
return min;
}
if ('TEAMCITY_VERSION' in env) {
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
}
if (env.COLORTERM === 'truecolor') {
return 3;
}
if ('TERM_PROGRAM' in env) {
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
switch (env.TERM_PROGRAM) {
case 'iTerm.app':
return version >= 3 ? 3 : 2;
case 'Apple_Terminal':
return 2;
// No default
}
}
if (/-256(color)?$/i.test(env.TERM)) {
return 2;
}
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
return 1;
}
if ('COLORTERM' in env) {
return 1;
}
if (env.TERM === 'dumb') {
return min;
}
return min;
}
function getSupportLevel(stream) {
const level = supportsColor(stream);
return translateLevel(level);
}
module.exports = {
supportsColor: getSupportLevel,
stdout: getSupportLevel(process.stdout),
stderr: getSupportLevel(process.stderr)
};

View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,53 @@
{
"name": "supports-color",
"version": "5.5.0",
"description": "Detect whether a terminal supports color",
"license": "MIT",
"repository": "chalk/supports-color",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js",
"browser.js"
],
"keywords": [
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"ansi",
"styles",
"tty",
"rgb",
"256",
"shell",
"xterm",
"command-line",
"support",
"supports",
"capability",
"detect",
"truecolor",
"16m"
],
"dependencies": {
"has-flag": "^3.0.0"
},
"devDependencies": {
"ava": "^0.25.0",
"import-fresh": "^2.0.0",
"xo": "^0.20.0"
},
"browser": "browser.js"
}

View File

@@ -0,0 +1,66 @@
# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
> Detect whether a terminal supports color
## Install
```
$ npm install supports-color
```
## Usage
```js
const supportsColor = require('supports-color');
if (supportsColor.stdout) {
console.log('Terminal stdout supports color');
}
if (supportsColor.stdout.has256) {
console.log('Terminal stdout supports 256 colors');
}
if (supportsColor.stderr.has16m) {
console.log('Terminal stderr supports 16 million colors (truecolor)');
}
```
## API
Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
- `.level = 2` and `.has256 = true`: 256 color support
- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
## Info
It obeys the `--color` and `--no-color` CLI flags.
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
## Related
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
## License
MIT

74
node_modules/nodemon/package.json generated vendored Normal file
View File

@@ -0,0 +1,74 @@
{
"name": "nodemon",
"homepage": "https://nodemon.io",
"author": {
"name": "Remy Sharp",
"url": "https://github.com/remy"
},
"bin": {
"nodemon": "./bin/nodemon.js"
},
"engines": {
"node": ">=8.10.0"
},
"repository": {
"type": "git",
"url": "https://github.com/remy/nodemon.git"
},
"description": "Simple monitor script for use during development of a Node.js app.",
"keywords": [
"cli",
"monitor",
"monitor",
"development",
"restart",
"autoload",
"reload",
"terminal"
],
"license": "MIT",
"main": "./lib/nodemon",
"scripts": {
"commitmsg": "commitlint -e",
"coverage": "istanbul cover _mocha -- --timeout 30000 --ui bdd --reporter list test/**/*.test.js",
"lint": "eslint lib/**/*.js",
"test": "npm run lint && npm run spec",
"spec": "for FILE in test/**/*.test.js; do echo $FILE; TEST=1 mocha --exit --timeout 30000 $FILE; if [ $? -ne 0 ]; then exit 1; fi; sleep 1; done",
"postspec": "npm run clean",
"clean": "rm -rf test/fixtures/test*.js test/fixtures/test*.md",
"web": "node web",
"semantic-release": "semantic-release",
"prepush": "npm run lint",
"killall": "ps auxww | grep node | grep -v grep | awk '{ print $2 }' | xargs kill -9"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"async": "1.4.2",
"coffee-script": "~1.7.1",
"eslint": "^7.32.0",
"husky": "^7.0.4",
"mocha": "^2.5.3",
"nyc": "^15.1.0",
"proxyquire": "^1.8.0",
"semantic-release": "^18.0.0",
"should": "~4.0.0"
},
"dependencies": {
"chokidar": "^3.5.2",
"debug": "^3.2.7",
"ignore-by-default": "^1.0.1",
"minimatch": "^3.1.2",
"pstree.remy": "^1.1.8",
"semver": "^5.7.1",
"simple-update-notifier": "^1.0.7",
"supports-color": "^5.5.0",
"touch": "^3.1.0",
"undefsafe": "^2.0.5"
},
"version": "2.0.22",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/nodemon"
}
}