This commit is contained in:
tatianamac
2019-11-26 14:50:43 -08:00
parent 8a55660ed0
commit 6d5445ecc5
13894 changed files with 2233957 additions and 0 deletions

1
node_modules/nunjucks/node_modules/.bin/window-size generated vendored Symbolic link
View File

@ -0,0 +1 @@
../window-size/cli.js

56
node_modules/nunjucks/node_modules/camelcase/index.js generated vendored Normal file
View File

@ -0,0 +1,56 @@
'use strict';
function preserveCamelCase(str) {
var isLastCharLower = false;
for (var i = 0; i < str.length; i++) {
var c = str.charAt(i);
if (isLastCharLower && (/[a-zA-Z]/).test(c) && c.toUpperCase() === c) {
str = str.substr(0, i) + '-' + str.substr(i);
isLastCharLower = false;
i++;
} else {
isLastCharLower = (c.toLowerCase() === c);
}
}
return str;
}
module.exports = function () {
var str = [].map.call(arguments, function (str) {
return str.trim();
}).filter(function (str) {
return str.length;
}).join('-');
if (!str.length) {
return '';
}
if (str.length === 1) {
return str;
}
if (!(/[_.\- ]+/).test(str)) {
if (str === str.toUpperCase()) {
return str.toLowerCase();
}
if (str[0] !== str[0].toLowerCase()) {
return str[0].toLowerCase() + str.slice(1);
}
return str;
}
str = preserveCamelCase(str);
return str
.replace(/^[_.\- ]+/, '')
.toLowerCase()
.replace(/[_.\- ]+(\w|$)/g, function (m, p1) {
return p1.toUpperCase();
});
};

21
node_modules/nunjucks/node_modules/camelcase/license generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
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,74 @@
{
"_args": [
[
"camelcase@2.1.1",
"/Users/tatiana/selfdefined"
]
],
"_from": "camelcase@2.1.1",
"_id": "camelcase@2.1.1",
"_inBundle": false,
"_integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=",
"_location": "/nunjucks/camelcase",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "camelcase@2.1.1",
"name": "camelcase",
"escapedName": "camelcase",
"rawSpec": "2.1.1",
"saveSpec": null,
"fetchSpec": "2.1.1"
},
"_requiredBy": [
"/nunjucks/yargs"
],
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
"_spec": "2.1.1",
"_where": "/Users/tatiana/selfdefined",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/camelcase/issues"
},
"description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/camelcase#readme",
"keywords": [
"camelcase",
"camel-case",
"camel",
"case",
"dash",
"hyphen",
"dot",
"underscore",
"separator",
"string",
"text",
"convert"
],
"license": "MIT",
"name": "camelcase",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/camelcase.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.1.1"
}

57
node_modules/nunjucks/node_modules/camelcase/readme.md generated vendored Normal file
View File

@ -0,0 +1,57 @@
# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)
> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`
## Install
```
$ npm install --save camelcase
```
## Usage
```js
const camelCase = require('camelcase');
camelCase('foo-bar');
//=> 'fooBar'
camelCase('foo_bar');
//=> 'fooBar'
camelCase('Foo-Bar');
//=> 'fooBar'
camelCase('--foo.bar');
//=> 'fooBar'
camelCase('__foo__bar__');
//=> 'fooBar'
camelCase('foo bar');
//=> 'fooBar'
console.log(process.argv[3]);
//=> '--foo-bar'
camelCase(process.argv[3]);
//=> 'fooBar'
camelCase('foo', 'bar');
//=> 'fooBar'
camelCase('__foo__', '--bar');
//=> 'fooBar'
```
## Related
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

View File

@ -0,0 +1,317 @@
# Chokidar 2.1.5 (Mar 22, 2019)
* Revert 2.1.3 atomic writing changes.
# Chokidar 2.1.4 (Mar 22, 2019)
* Improve TypeScript type definitions for `on` method.
# Chokidar 2.1.3 (Mar 22, 2019)
* Improve atomic writes handling
# Chokidar 2.1.2 (Feb 18, 2019)
* Add TypeScript type definitions
* More fixes for accessTime behavior (#800)
# Chokidar 2.1.1 (Feb 8, 2019)
* Handle simultaneous change of LastAccessTime and ModifiedTime (#793)
# Chokidar 2.1.0 (Feb 5, 2019)
* Ignore accessTime updates caused by read operations (#762).
* Updated dependencies. Removed `lodash.debounce`.
# Chokidar 2.0.4 (Jun 18, 2018)
* Prevent watcher.close() from crashing (#730).
# Chokidar 2.0.3 (Mar 22, 2018)
* Fixes an issue that using fd = 0 is not closed in case
Windows is used and a `EPERM` error is triggered.
# Chokidar 2.0.2 (Feb 14, 2018)
* Allow semver range updates for upath dependency
# Chokidar 2.0.1 (Feb 8, 2018)
* Fix #668 glob issue on Windows when using `ignore` and `cwd`. Thanks @remy!
* Fix #546 possible uncaught exception when using `awaitWriteFinish`.
Thanks @dsagal!
# Chokidar 2.0.0 (Dec 29, 2017)
* Breaking: Upgrade globbing dependencies which require globs to be more strict and always use POSIX-style slashes because Windows-style slashes are used as escape sequences
* Update tests to work with upgraded globbing dependencies
* Add ability to log FSEvents require error by setting `CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR` env
* Fix for handling braces in globs
* Add node 8 & 9 to CI configs
* Allow node 0.10 failures on Windows
# Chokidar 1.7.0 (May 8, 2017)
* Add `disableGlobbing` option
* Add ability to force interval value by setting CHOKIDAR_INTERVAL env
variable
* Fix issue with `.close()` being called before `ready`
# Chokidar 1.6.0 (Jun 22, 2016)
* Added ability for force `usePolling` mode by setting `CHOKIDAR_USEPOLLING`
env variable
# Chokidar 1.5.2 (Jun 7, 2016)
* Fix missing `addDir` events when using `cwd` and `alwaysStat` options
* Fix missing `add` events for files within a renamed directory
# Chokidar 1.5.1 (May 20, 2016)
* To help prevent exhaustion of FSEvents system limitations, consolidate watch
instances to the common parent upon detection of separate watch instances on
many siblings
# Chokidar 1.5.0 (May 10, 2016)
* Make debounce delay setting used with `atomic: true` user-customizable
* Fixes and improvements to `awaitWriteFinish` features
# Chokidar 1.4.3 (Feb 26, 2016)
* Update async-each dependency to ^1.0.0
# Chokidar 1.4.2 (Dec 30, 2015)
* Now correctly emitting `stats` with `awaitWriteFinish` option.
# Chokidar 1.4.1 (Dec 9, 2015)
* The watcher could now be correctly subclassed with ES6 class syntax.
# Chokidar 1.4.0 (Dec 3, 2015)
* Add `.getWatched()` method, exposing all file system entries being watched
* Apply `awaitWriteFinish` methodology to `change` events (in addition to `add`)
* Fix handling of symlinks within glob paths (#293)
* Fix `addDir` and `unlinkDir` events under globs (#337, #401)
* Fix issues with `.unwatch()` (#374, #403)
# Chokidar 1.3.0 (Nov 18, 2015)
* Improve `awaitWriteFinish` option behavior
* Fix some `cwd` option behavior on Windows
* `awaitWriteFinish` and `cwd` are now compatible
* Fix some race conditions.
* #379: Recreating deleted directory doesn't trigger event
* When adding a previously-deleted file, emit 'add', not 'change'
# Chokidar 1.2.0 (Oct 1, 2015)
* Allow nested arrays of paths to be provided to `.watch()` and `.add()`
* Add `awaitWriteFinish` option
# Chokidar 1.1.0 (Sep 23, 2015)
* Dependency updates including fsevents@1.0.0, improving installation
# Chokidar 1.0.6 (Sep 18, 2015)
* Fix issue with `.unwatch()` method and relative paths
# Chokidar 1.0.5 (Jul 20, 2015)
* Fix regression with regexes/fns using in `ignored`
# Chokidar 1.0.4 (Jul 15, 2015)
* Fix bug with `ignored` files/globs while `cwd` option is set
# Chokidar 1.0.3 (Jun 4, 2015)
* Fix race issue with `alwaysStat` option and removed files
# Chokidar 1.0.2 (May 30, 2015)
* Fix bug with absolute paths and ENAMETOOLONG error
# Chokidar 1.0.1 (Apr 8, 2015)
* Fix bug with `.close()` method in `fs.watch` mode with `persistent: false`
option
# Chokidar 1.0.0 (Apr 7, 2015)
* Glob support! Use globs in `watch`, `add`, and `unwatch` methods
* Comprehensive symlink support
* New `unwatch` method to turn off watching of previously watched paths
* More flexible `ignored` option allowing regex, function, glob, or array
courtesy of [anymatch](https://github.com/es128/anymatch)
* New `cwd` option to set base dir from which relative paths are derived
* New `depth` option for limiting recursion
* New `alwaysStat` option to ensure
[`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) gets passed
with every add/change event
* New `ready` event emitted when initial fs tree scan is done and watcher is
ready for changes
* New `raw` event exposing data and events from the lower-level watch modules
* New `followSymlinks` option to impact whether symlinks' targets or the symlink
files themselves are watched
* New `atomic` option for normalizing artifacts from text editors that use
atomic write methods
* Ensured watcher's stability with lots of bugfixes.
# Chokidar 0.12.6 (Jan 6, 2015)
* Fix bug which breaks `persistent: false` mode when change events occur
# Chokidar 0.12.5 (Dec 17, 2014)
* Fix bug with matching parent path detection for fsevents instance sharing
* Fix bug with ignored watch path in nodefs modes
# Chokidar 0.12.4 (Dec 14, 2014)
* Fix bug in `fs.watch` mode that caused watcher to leak into `cwd`
* Fix bug preventing ready event when there are symlinks to ignored paths
# Chokidar 0.12.3 (Dec 13, 2014)
* Fix handling of special files such as named pipes and sockets
# Chokidar 0.12.2 (Dec 12, 2014)
* Fix recursive symlink handling and some other path resolution problems
# Chokidar 0.12.1 (Dec 10, 2014)
* Fix a case where file symlinks were not followed properly
# Chokidar 0.12.0 (Dec 8, 2014)
* Symlink support
* Add `followSymlinks` option, which defaults to `true`
* Change default watch mode on Linux to non-polling `fs.watch`
* Add `atomic` option to normalize events from editors using atomic writes
* Particularly Vim and Sublime
* Add `raw` event which exposes data from the underlying watch method
# Chokidar 0.11.1 (Nov 19, 2014)
* Fix a bug where an error is thrown when `fs.watch` instantiation fails
# Chokidar 0.11.0 (Nov 16, 2014)
* Add a `ready` event, which is emitted after initial file scan completes
* Fix issue with options keys passed in defined as `undefined`
* Rename some internal `FSWatcher` properties to indicate they're private
# Chokidar 0.10.9 (Nov 15, 2014)
* Fix some leftover issues from adding watcher reuse
# Chokidar 0.10.8 (Nov 14, 2014)
* Remove accidentally committed/published `console.log` statement.
* Sry 'bout that :crying_cat_face:
# Chokidar 0.10.7 (Nov 14, 2014)
* Apply watcher reuse methodology to `fs.watch` and `fs.watchFile` as well
# Chokidar 0.10.6 (Nov 12, 2014)
* More efficient creation/reuse of FSEvents instances to avoid system limits
* Reduce simultaneous FSEvents instances allowed in a process
* Handle errors thrown by `fs.watch` upon invocation
# Chokidar 0.10.5 (Nov 6, 2014)
* Limit number of simultaneous FSEvents instances (fall back to other methods)
* Prevent some cases of EMFILE errors during initialization
* Fix ignored files emitting events in some fsevents-mode circumstances
# Chokidar 0.10.4 (Nov 5, 2014)
* Bump fsevents dependency to ~0.3.1
* Should resolve build warnings and `npm rebuild` on non-Macs
# Chokidar 0.10.3 (Oct 28, 2014)
* Fix removed dir emitting as `unlink` instead of `unlinkDir`
* Fix issues with file changing to dir or vice versa (gh-165)
* Fix handling of `ignored` option in fsevents mode
# Chokidar 0.10.2 (Oct 23, 2014)
* Improve individual file watching
* Fix fsevents keeping process alive when `persistent: false`
# Chokidar 0.10.1 (19 October 2014)
* Improve handling of text editor atomic writes
# Chokidar 0.10.0 (Oct 18, 2014)
* Many stability and consistency improvements
* Resolve many cases of duplicate or wrong events
* Correct for fsevents inconsistencies
* Standardize handling of errors and relative paths
* Fix issues with watching `./`
# Chokidar 0.9.0 (Sep 25, 2014)
* Updated fsevents to 0.3
* Update per-system defaults
* Fix issues with closing chokidar instance
* Fix duplicate change events on win32
# Chokidar 0.8.2 (Mar 26, 2014)
* Fixed npm issues related to fsevents dep.
* Updated fsevents to 0.2.
# Chokidar 0.8.1 (Dec 16, 2013)
* Optional deps are now truly optional on windows and
linux.
* Rewritten in JS, again.
* Fixed some FSEvents-related bugs.
# Chokidar 0.8.0 (Nov 29, 2013)
* Added ultra-fast low-CPU OS X file watching with FSEvents.
It is enabled by default.
* Added `addDir` and `unlinkDir` events.
* Polling is now disabled by default on all platforms.
# Chokidar 0.7.1 (Nov 18, 2013)
* `Watcher#close` now also removes all event listeners.
# Chokidar 0.7.0 (Oct 22, 2013)
* When `options.ignored` is two-argument function, it will
also be called after stating the FS, with `stats` argument.
* `unlink` is no longer emitted on directories.
# Chokidar 0.6.3 (Aug 12, 2013)
* Added `usePolling` option (default: `true`).
When `false`, chokidar will use `fs.watch` as backend.
`fs.watch` is much faster, but not like super reliable.
# Chokidar 0.6.2 (Mar 19, 2013)
* Fixed watching initially empty directories with `ignoreInitial` option.
# Chokidar 0.6.1 (Mar 19, 2013)
* Added node.js 0.10 support.
# Chokidar 0.6.0 (Mar 10, 2013)
* File attributes (stat()) are now passed to `add` and `change` events as second
arguments.
* Changed default polling interval for binary files to 300ms.
# Chokidar 0.5.3 (Jan 13, 2013)
* Removed emitting of `change` events before `unlink`.
# Chokidar 0.5.2 (Jan 13, 2013)
* Removed postinstall script to prevent various npm bugs.
# Chokidar 0.5.1 (Jan 6, 2013)
* When starting to watch non-existing paths, chokidar will no longer throw
ENOENT error.
* Fixed bug with absolute path.
# Chokidar 0.5.0 (Dec 9, 2012)
* Added a bunch of new options:
* `ignoreInitial` that allows to ignore initial `add` events.
* `ignorePermissionErrors` that allows to ignore ENOENT etc perm errors.
* `interval` and `binaryInterval` that allow to change default
fs polling intervals.
# Chokidar 0.4.0 (Jul 26, 2012)
* Added `all` event that receives two args (event name and path) that combines
`add`, `change` and `unlink` events.
* Switched to `fs.watchFile` on node.js 0.8 on windows.
* Files are now correctly unwatched after unlink.
# Chokidar 0.3.0 (Jun 24, 2012)
* `unlink` event are no longer emitted for directories, for consistency with
`add`.
# Chokidar 0.2.6 (Jun 8, 2012)
* Prevented creating of duplicate 'add' events.
# Chokidar 0.2.5 (Jun 8, 2012)
* Fixed a bug when new files in new directories hadn't been added.
# Chokidar 0.2.4 (Jun 7, 2012)
* Fixed a bug when unlinked files emitted events after unlink.
# Chokidar 0.2.3 (May 12, 2012)
* Fixed watching of files on windows.
# Chokidar 0.2.2 (May 4, 2012)
* Fixed watcher signature.
# Chokidar 0.2.1 (May 4, 2012)
* Fixed invalid API bug when using `watch()`.
# Chokidar 0.2.0 (May 4, 2012)
* Rewritten in js.
# Chokidar 0.1.1 (Apr 26, 2012)
* Changed api to `chokidar.watch()`.
* Fixed compilation on windows.
# Chokidar 0.1.0 (Apr 20, 2012)
* Initial release, extracted from
[Brunch](https://github.com/brunch/brunch/blob/9847a065aea300da99bd0753f90354cde9de1261/src/helpers.coffee#L66)

294
node_modules/nunjucks/node_modules/chokidar/README.md generated vendored Normal file
View File

@ -0,0 +1,294 @@
# Chokidar [![Weekly downloads](https://img.shields.io/npm/dw/chokidar.svg)](https://github.com/paulmillr/chokidar) [![Yearly downloads](https://img.shields.io/npm/dy/chokidar.svg)](https://github.com/paulmillr/chokidar) [![Mac/Linux Build Status](https://img.shields.io/travis/paulmillr/chokidar/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/paulmillr/chokidar) [![Windows Build status](https://img.shields.io/appveyor/ci/paulmillr/chokidar/master.svg?label=Windows)](https://ci.appveyor.com/project/paulmillr/chokidar/branch/master) [![Coverage Status](https://coveralls.io/repos/paulmillr/chokidar/badge.svg)](https://coveralls.io/r/paulmillr/chokidar)
> A neat wrapper around node.js fs.watch / fs.watchFile / FSEvents.
[![NPM](https://nodei.co/npm/chokidar.png)](https://www.npmjs.com/package/chokidar)
## Why?
Node.js `fs.watch`:
* Doesn't report filenames on MacOS.
* Doesn't report events at all when using editors like Sublime on MacOS.
* Often reports events twice.
* Emits most changes as `rename`.
* Has [a lot of other issues](https://github.com/nodejs/node/search?q=fs.watch&type=Issues)
* Does not provide an easy way to recursively watch file trees.
Node.js `fs.watchFile`:
* Almost as bad at event handling.
* Also does not provide any recursive watching.
* Results in high CPU utilization.
Chokidar resolves these problems.
Initially made for **[Brunch](http://brunch.io)** (an ultra-swift web app build tool), it is now used in
[gulp](https://github.com/gulpjs/gulp/),
[karma](http://karma-runner.github.io),
[PM2](https://github.com/Unitech/PM2),
[browserify](http://browserify.org/),
[webpack](http://webpack.github.io/),
[BrowserSync](http://www.browsersync.io/),
[Microsoft's Visual Studio Code](https://github.com/microsoft/vscode),
and [many others](https://www.npmjs.org/browse/depended/chokidar/).
It has proven itself in production environments.
## How?
Chokidar does still rely on the Node.js core `fs` module, but when using
`fs.watch` and `fs.watchFile` for watching, it normalizes the events it
receives, often checking for truth by getting file stats and/or dir contents.
On MacOS, chokidar by default uses a native extension exposing the Darwin
`FSEvents` API. This provides very efficient recursive watching compared with
implementations like `kqueue` available on most \*nix platforms. Chokidar still
does have to do some work to normalize the events received that way as well.
On other platforms, the `fs.watch`-based implementation is the default, which
avoids polling and keeps CPU usage down. Be advised that chokidar will initiate
watchers recursively for everything within scope of the paths that have been
specified, so be judicious about not wasting system resources by watching much
more than needed.
## Getting started
Install with npm:
```sh
npm install chokidar
```
Then `require` and use it in your code:
```javascript
var chokidar = require('chokidar');
// One-liner for current directory, ignores .dotfiles
chokidar.watch('.', {ignored: /(^|[\/\\])\../}).on('all', (event, path) => {
console.log(event, path);
});
```
```javascript
// Example of a more typical implementation structure:
// Initialize watcher.
var watcher = chokidar.watch('file, dir, glob, or array', {
ignored: /(^|[\/\\])\../,
persistent: true
});
// Something to use when events are received.
var log = console.log.bind(console);
// Add event listeners.
watcher
.on('add', path => log(`File ${path} has been added`))
.on('change', path => log(`File ${path} has been changed`))
.on('unlink', path => log(`File ${path} has been removed`));
// More possible events.
watcher
.on('addDir', path => log(`Directory ${path} has been added`))
.on('unlinkDir', path => log(`Directory ${path} has been removed`))
.on('error', error => log(`Watcher error: ${error}`))
.on('ready', () => log('Initial scan complete. Ready for changes'))
.on('raw', (event, path, details) => {
log('Raw event info:', event, path, details);
});
// 'add', 'addDir' and 'change' events also receive stat() results as second
// argument when available: http://nodejs.org/api/fs.html#fs_class_fs_stats
watcher.on('change', (path, stats) => {
if (stats) console.log(`File ${path} changed size to ${stats.size}`);
});
// Watch new files.
watcher.add('new-file');
watcher.add(['new-file-2', 'new-file-3', '**/other-file*']);
// Get list of actual paths being watched on the filesystem
var watchedPaths = watcher.getWatched();
// Un-watch some files.
watcher.unwatch('new-file*');
// Stop watching.
watcher.close();
// Full list of options. See below for descriptions. (do not use this example)
chokidar.watch('file', {
persistent: true,
ignored: '*.txt',
ignoreInitial: false,
followSymlinks: true,
cwd: '.',
disableGlobbing: false,
usePolling: true,
interval: 100,
binaryInterval: 300,
alwaysStat: false,
depth: 99,
awaitWriteFinish: {
stabilityThreshold: 2000,
pollInterval: 100
},
ignorePermissionErrors: false,
atomic: true // or a custom 'atomicity delay', in milliseconds (default 100)
});
```
## API
`chokidar.watch(paths, [options])`
* `paths` (string or array of strings). Paths to files, dirs to be watched
recursively, or glob patterns.
* `options` (object) Options object as defined below:
#### Persistence
* `persistent` (default: `true`). Indicates whether the process
should continue to run as long as files are being watched. If set to
`false` when using `fsevents` to watch, no more events will be emitted
after `ready`, even if the process continues to run.
#### Path filtering
* `ignored` ([anymatch](https://github.com/es128/anymatch)-compatible definition)
Defines files/paths to be ignored. The whole relative or absolute path is
tested, not just filename. If a function with two arguments is provided, it
gets called twice per path - once with a single argument (the path), second
time with two arguments (the path and the
[`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats)
object of that path).
* `ignoreInitial` (default: `false`). If set to `false` then `add`/`addDir` events are also emitted for matching paths while
instantiating the watching as chokidar discovers these file paths (before the `ready` event).
* `followSymlinks` (default: `true`). When `false`, only the
symlinks themselves will be watched for changes instead of following
the link references and bubbling events through the link's path.
* `cwd` (no default). The base directory from which watch `paths` are to be
derived. Paths emitted with events will be relative to this.
* `disableGlobbing` (default: `false`). If set to `true` then the strings passed to `.watch()` and `.add()` are treated as
literal path names, even if they look like globs.
#### Performance
* `usePolling` (default: `false`).
Whether to use fs.watchFile (backed by polling), or fs.watch. If polling
leads to high CPU utilization, consider setting this to `false`. It is
typically necessary to **set this to `true` to successfully watch files over
a network**, and it may be necessary to successfully watch files in other
non-standard situations. Setting to `true` explicitly on MacOS overrides the
`useFsEvents` default. You may also set the CHOKIDAR_USEPOLLING env variable
to true (1) or false (0) in order to override this option.
* _Polling-specific settings_ (effective when `usePolling: true`)
* `interval` (default: `100`). Interval of file system polling. You may also
set the CHOKIDAR_INTERVAL env variable to override this option.
* `binaryInterval` (default: `300`). Interval of file system
polling for binary files.
([see list of binary extensions](https://github.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
* `useFsEvents` (default: `true` on MacOS). Whether to use the
`fsevents` watching interface if available. When set to `true` explicitly
and `fsevents` is available this supercedes the `usePolling` setting. When
set to `false` on MacOS, `usePolling: true` becomes the default.
* `alwaysStat` (default: `false`). If relying upon the
[`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats)
object that may get passed with `add`, `addDir`, and `change` events, set
this to `true` to ensure it is provided even in cases where it wasn't
already available from the underlying watch events.
* `depth` (default: `undefined`). If set, limits how many levels of
subdirectories will be traversed.
* `awaitWriteFinish` (default: `false`).
By default, the `add` event will fire when a file first appears on disk, before
the entire file has been written. Furthermore, in some cases some `change`
events will be emitted while the file is being written. In some cases,
especially when watching for large files there will be a need to wait for the
write operation to finish before responding to a file creation or modification.
Setting `awaitWriteFinish` to `true` (or a truthy value) will poll file size,
holding its `add` and `change` events until the size does not change for a
configurable amount of time. The appropriate duration setting is heavily
dependent on the OS and hardware. For accurate detection this parameter should
be relatively high, making file watching much less responsive.
Use with caution.
* *`options.awaitWriteFinish` can be set to an object in order to adjust
timing params:*
* `awaitWriteFinish.stabilityThreshold` (default: 2000). Amount of time in
milliseconds for a file size to remain constant before emitting its event.
* `awaitWriteFinish.pollInterval` (default: 100). File size polling interval.
#### Errors
* `ignorePermissionErrors` (default: `false`). Indicates whether to watch files
that don't have read permissions if possible. If watching fails due to `EPERM`
or `EACCES` with this set to `true`, the errors will be suppressed silently.
* `atomic` (default: `true` if `useFsEvents` and `usePolling` are `false`).
Automatically filters out artifacts that occur when using editors that use
"atomic writes" instead of writing directly to the source file. If a file is
re-added within 100 ms of being deleted, Chokidar emits a `change` event
rather than `unlink` then `add`. If the default of 100 ms does not work well
for you, you can override it by setting `atomic` to a custom value, in
milliseconds.
### Methods & Events
`chokidar.watch()` produces an instance of `FSWatcher`. Methods of `FSWatcher`:
* `.add(path / paths)`: Add files, directories, or glob patterns for tracking.
Takes an array of strings or just one string.
* `.on(event, callback)`: Listen for an FS event.
Available events: `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `ready`,
`raw`, `error`.
Additionally `all` is available which gets emitted with the underlying event
name and path for every event other than `ready`, `raw`, and `error`.
* `.unwatch(path / paths)`: Stop watching files, directories, or glob patterns.
Takes an array of strings or just one string.
* `.close()`: Removes all listeners from watched files.
* `.getWatched()`: Returns an object representing all the paths on the file
system being watched by this `FSWatcher` instance. The object's keys are all the
directories (using absolute paths unless the `cwd` option was used), and the
values are arrays of the names of the items contained in each directory.
## CLI
If you need a CLI interface for your file watching, check out
[chokidar-cli](https://github.com/kimmobrunfeldt/chokidar-cli), allowing you to
execute a command on each change, or get a stdio stream of change events.
## Install Troubleshooting
* `npm WARN optional dep failed, continuing fsevents@n.n.n`
* This message is normal part of how `npm` handles optional dependencies and is
not indicative of a problem. Even if accompanied by other related error messages,
Chokidar should function properly.
* `ERR! stack Error: Python executable "python" is v3.4.1, which is not supported by gyp.`
* You should be able to resolve this by installing python 2.7 and running:
`npm config set python python2.7`
* `gyp ERR! stack Error: not found: make`
* On Mac, install the XCode command-line tools
## License
The MIT License (MIT)
Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com) & Elan Shanker
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.

747
node_modules/nunjucks/node_modules/chokidar/index.js generated vendored Normal file
View File

@ -0,0 +1,747 @@
'use strict';
var EventEmitter = require('events').EventEmitter;
var fs = require('fs');
var sysPath = require('path');
var asyncEach = require('async-each');
var anymatch = require('anymatch');
var globParent = require('glob-parent');
var isGlob = require('is-glob');
var isAbsolute = require('path-is-absolute');
var inherits = require('inherits');
var braces = require('braces');
var normalizePath = require('normalize-path');
var upath = require('upath');
var NodeFsHandler = require('./lib/nodefs-handler');
var FsEventsHandler = require('./lib/fsevents-handler');
var arrify = function(value) {
if (value == null) return [];
return Array.isArray(value) ? value : [value];
};
var flatten = function(list, result) {
if (result == null) result = [];
list.forEach(function(item) {
if (Array.isArray(item)) {
flatten(item, result);
} else {
result.push(item);
}
});
return result;
};
// Little isString util for use in Array#every.
var isString = function(thing) {
return typeof thing === 'string';
};
// Public: Main class.
// Watches files & directories for changes.
//
// * _opts - object, chokidar options hash
//
// Emitted events:
// `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
//
// Examples
//
// var watcher = new FSWatcher()
// .add(directories)
// .on('add', path => console.log('File', path, 'was added'))
// .on('change', path => console.log('File', path, 'was changed'))
// .on('unlink', path => console.log('File', path, 'was removed'))
// .on('all', (event, path) => console.log(path, ' emitted ', event))
//
function FSWatcher(_opts) {
EventEmitter.call(this);
var opts = {};
// in case _opts that is passed in is a frozen object
if (_opts) for (var opt in _opts) opts[opt] = _opts[opt];
this._watched = Object.create(null);
this._closers = Object.create(null);
this._ignoredPaths = Object.create(null);
Object.defineProperty(this, '_globIgnored', {
get: function() { return Object.keys(this._ignoredPaths); }
});
this.closed = false;
this._throttled = Object.create(null);
this._symlinkPaths = Object.create(null);
function undef(key) {
return opts[key] === undefined;
}
// Set up default options.
if (undef('persistent')) opts.persistent = true;
if (undef('ignoreInitial')) opts.ignoreInitial = false;
if (undef('ignorePermissionErrors')) opts.ignorePermissionErrors = false;
if (undef('interval')) opts.interval = 100;
if (undef('binaryInterval')) opts.binaryInterval = 300;
if (undef('disableGlobbing')) opts.disableGlobbing = false;
this.enableBinaryInterval = opts.binaryInterval !== opts.interval;
// Enable fsevents on OS X when polling isn't explicitly enabled.
if (undef('useFsEvents')) opts.useFsEvents = !opts.usePolling;
// If we can't use fsevents, ensure the options reflect it's disabled.
if (!FsEventsHandler.canUse()) opts.useFsEvents = false;
// Use polling on Mac if not using fsevents.
// Other platforms use non-polling fs.watch.
if (undef('usePolling') && !opts.useFsEvents) {
opts.usePolling = process.platform === 'darwin';
}
// Global override (useful for end-developers that need to force polling for all
// instances of chokidar, regardless of usage/dependency depth)
var envPoll = process.env.CHOKIDAR_USEPOLLING;
if (envPoll !== undefined) {
var envLower = envPoll.toLowerCase();
if (envLower === 'false' || envLower === '0') {
opts.usePolling = false;
} else if (envLower === 'true' || envLower === '1') {
opts.usePolling = true;
} else {
opts.usePolling = !!envLower
}
}
var envInterval = process.env.CHOKIDAR_INTERVAL;
if (envInterval) {
opts.interval = parseInt(envInterval);
}
// Editor atomic write normalization enabled by default with fs.watch
if (undef('atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents;
if (opts.atomic) this._pendingUnlinks = Object.create(null);
if (undef('followSymlinks')) opts.followSymlinks = true;
if (undef('awaitWriteFinish')) opts.awaitWriteFinish = false;
if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};
var awf = opts.awaitWriteFinish;
if (awf) {
if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000;
if (!awf.pollInterval) awf.pollInterval = 100;
this._pendingWrites = Object.create(null);
}
if (opts.ignored) opts.ignored = arrify(opts.ignored);
this._isntIgnored = function(path, stat) {
return !this._isIgnored(path, stat);
}.bind(this);
var readyCalls = 0;
this._emitReady = function() {
if (++readyCalls >= this._readyCount) {
this._emitReady = Function.prototype;
this._readyEmitted = true;
// use process.nextTick to allow time for listener to be bound
process.nextTick(this.emit.bind(this, 'ready'));
}
}.bind(this);
this.options = opts;
// Youre frozen when your hearts not open.
Object.freeze(opts);
}
inherits(FSWatcher, EventEmitter);
// Common helpers
// --------------
// Private method: Normalize and emit events
//
// * event - string, type of event
// * path - string, file or directory path
// * val[1..3] - arguments to be passed with event
//
// Returns the error if defined, otherwise the value of the
// FSWatcher instance's `closed` flag
FSWatcher.prototype._emit = function(event, path, val1, val2, val3) {
if (this.options.cwd) path = sysPath.relative(this.options.cwd, path);
var args = [event, path];
if (val3 !== undefined) args.push(val1, val2, val3);
else if (val2 !== undefined) args.push(val1, val2);
else if (val1 !== undefined) args.push(val1);
var awf = this.options.awaitWriteFinish;
if (awf && this._pendingWrites[path]) {
this._pendingWrites[path].lastChange = new Date();
return this;
}
if (this.options.atomic) {
if (event === 'unlink') {
this._pendingUnlinks[path] = args;
setTimeout(function() {
Object.keys(this._pendingUnlinks).forEach(function(path) {
this.emit.apply(this, this._pendingUnlinks[path]);
this.emit.apply(this, ['all'].concat(this._pendingUnlinks[path]));
delete this._pendingUnlinks[path];
}.bind(this));
}.bind(this), typeof this.options.atomic === "number"
? this.options.atomic
: 100);
return this;
} else if (event === 'add' && this._pendingUnlinks[path]) {
event = args[0] = 'change';
delete this._pendingUnlinks[path];
}
}
var emitEvent = function() {
this.emit.apply(this, args);
if (event !== 'error') this.emit.apply(this, ['all'].concat(args));
}.bind(this);
if (awf && (event === 'add' || event === 'change') && this._readyEmitted) {
var awfEmit = function(err, stats) {
if (err) {
event = args[0] = 'error';
args[1] = err;
emitEvent();
} else if (stats) {
// if stats doesn't exist the file must have been deleted
if (args.length > 2) {
args[2] = stats;
} else {
args.push(stats);
}
emitEvent();
}
};
this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);
return this;
}
if (event === 'change') {
if (!this._throttle('change', path, 50)) return this;
}
if (
this.options.alwaysStat && val1 === undefined &&
(event === 'add' || event === 'addDir' || event === 'change')
) {
var fullPath = this.options.cwd ? sysPath.join(this.options.cwd, path) : path;
fs.stat(fullPath, function(error, stats) {
// Suppress event when fs.stat fails, to avoid sending undefined 'stat'
if (error || !stats) return;
args.push(stats);
emitEvent();
});
} else {
emitEvent();
}
return this;
};
// Private method: Common handler for errors
//
// * error - object, Error instance
//
// Returns the error if defined, otherwise the value of the
// FSWatcher instance's `closed` flag
FSWatcher.prototype._handleError = function(error) {
var code = error && error.code;
var ipe = this.options.ignorePermissionErrors;
if (error &&
code !== 'ENOENT' &&
code !== 'ENOTDIR' &&
(!ipe || (code !== 'EPERM' && code !== 'EACCES'))
) this.emit('error', error);
return error || this.closed;
};
// Private method: Helper utility for throttling
//
// * action - string, type of action being throttled
// * path - string, path being acted upon
// * timeout - int, duration of time to suppress duplicate actions
//
// Returns throttle tracking object or false if action should be suppressed
FSWatcher.prototype._throttle = function(action, path, timeout) {
if (!(action in this._throttled)) {
this._throttled[action] = Object.create(null);
}
var throttled = this._throttled[action];
if (path in throttled) {
throttled[path].count++;
return false;
}
function clear() {
var count = throttled[path] ? throttled[path].count : 0;
delete throttled[path];
clearTimeout(timeoutObject);
return count;
}
var timeoutObject = setTimeout(clear, timeout);
throttled[path] = {timeoutObject: timeoutObject, clear: clear, count: 0};
return throttled[path];
};
// Private method: Awaits write operation to finish
//
// * path - string, path being acted upon
// * threshold - int, time in milliseconds a file size must be fixed before
// acknowledging write operation is finished
// * awfEmit - function, to be called when ready for event to be emitted
// Polls a newly created file for size variations. When files size does not
// change for 'threshold' milliseconds calls callback.
FSWatcher.prototype._awaitWriteFinish = function(path, threshold, event, awfEmit) {
var timeoutHandler;
var fullPath = path;
if (this.options.cwd && !isAbsolute(path)) {
fullPath = sysPath.join(this.options.cwd, path);
}
var now = new Date();
var awaitWriteFinish = (function (prevStat) {
fs.stat(fullPath, function(err, curStat) {
if (err || !(path in this._pendingWrites)) {
if (err && err.code !== 'ENOENT') awfEmit(err);
return;
}
var now = new Date();
if (prevStat && curStat.size != prevStat.size) {
this._pendingWrites[path].lastChange = now;
}
if (now - this._pendingWrites[path].lastChange >= threshold) {
delete this._pendingWrites[path];
awfEmit(null, curStat);
} else {
timeoutHandler = setTimeout(
awaitWriteFinish.bind(this, curStat),
this.options.awaitWriteFinish.pollInterval
);
}
}.bind(this));
}.bind(this));
if (!(path in this._pendingWrites)) {
this._pendingWrites[path] = {
lastChange: now,
cancelWait: function() {
delete this._pendingWrites[path];
clearTimeout(timeoutHandler);
return event;
}.bind(this)
};
timeoutHandler = setTimeout(
awaitWriteFinish.bind(this),
this.options.awaitWriteFinish.pollInterval
);
}
};
// Private method: Determines whether user has asked to ignore this path
//
// * path - string, path to file or directory
// * stats - object, result of fs.stat
//
// Returns boolean
var dotRe = /\..*\.(sw[px])$|\~$|\.subl.*\.tmp/;
FSWatcher.prototype._isIgnored = function(path, stats) {
if (this.options.atomic && dotRe.test(path)) return true;
if (!this._userIgnored) {
var cwd = this.options.cwd;
var ignored = this.options.ignored;
if (cwd && ignored) {
ignored = ignored.map(function (path) {
if (typeof path !== 'string') return path;
return upath.normalize(isAbsolute(path) ? path : sysPath.join(cwd, path));
});
}
var paths = arrify(ignored)
.filter(function(path) {
return typeof path === 'string' && !isGlob(path);
}).map(function(path) {
return path + '/**';
});
this._userIgnored = anymatch(
this._globIgnored.concat(ignored).concat(paths)
);
}
return this._userIgnored([path, stats]);
};
// Private method: Provides a set of common helpers and properties relating to
// symlink and glob handling
//
// * path - string, file, directory, or glob pattern being watched
// * depth - int, at any depth > 0, this isn't a glob
//
// Returns object containing helpers for this path
var replacerRe = /^\.[\/\\]/;
FSWatcher.prototype._getWatchHelpers = function(path, depth) {
path = path.replace(replacerRe, '');
var watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path);
var fullWatchPath = sysPath.resolve(watchPath);
var hasGlob = watchPath !== path;
var globFilter = hasGlob ? anymatch(path) : false;
var follow = this.options.followSymlinks;
var globSymlink = hasGlob && follow ? null : false;
var checkGlobSymlink = function(entry) {
// only need to resolve once
// first entry should always have entry.parentDir === ''
if (globSymlink == null) {
globSymlink = entry.fullParentDir === fullWatchPath ? false : {
realPath: entry.fullParentDir,
linkPath: fullWatchPath
};
}
if (globSymlink) {
return entry.fullPath.replace(globSymlink.realPath, globSymlink.linkPath);
}
return entry.fullPath;
};
var entryPath = function(entry) {
return sysPath.join(watchPath,
sysPath.relative(watchPath, checkGlobSymlink(entry))
);
};
var filterPath = function(entry) {
if (entry.stat && entry.stat.isSymbolicLink()) return filterDir(entry);
var resolvedPath = entryPath(entry);
return (!hasGlob || globFilter(resolvedPath)) &&
this._isntIgnored(resolvedPath, entry.stat) &&
(this.options.ignorePermissionErrors ||
this._hasReadPermissions(entry.stat));
}.bind(this);
var getDirParts = function(path) {
if (!hasGlob) return false;
var parts = [];
var expandedPath = braces.expand(path);
expandedPath.forEach(function(path) {
parts.push(sysPath.relative(watchPath, path).split(/[\/\\]/));
});
return parts;
};
var dirParts = getDirParts(path);
if (dirParts) {
dirParts.forEach(function(parts) {
if (parts.length > 1) parts.pop();
});
}
var unmatchedGlob;
var filterDir = function(entry) {
if (hasGlob) {
var entryParts = getDirParts(checkGlobSymlink(entry));
var globstar = false;
unmatchedGlob = !dirParts.some(function(parts) {
return parts.every(function(part, i) {
if (part === '**') globstar = true;
return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i]);
});
});
}
return !unmatchedGlob && this._isntIgnored(entryPath(entry), entry.stat);
}.bind(this);
return {
followSymlinks: follow,
statMethod: follow ? 'stat' : 'lstat',
path: path,
watchPath: watchPath,
entryPath: entryPath,
hasGlob: hasGlob,
globFilter: globFilter,
filterPath: filterPath,
filterDir: filterDir
};
};
// Directory helpers
// -----------------
// Private method: Provides directory tracking objects
//
// * directory - string, path of the directory
//
// Returns the directory's tracking object
FSWatcher.prototype._getWatchedDir = function(directory) {
var dir = sysPath.resolve(directory);
var watcherRemove = this._remove.bind(this);
if (!(dir in this._watched)) this._watched[dir] = {
_items: Object.create(null),
add: function(item) {
if (item !== '.' && item !== '..') this._items[item] = true;
},
remove: function(item) {
delete this._items[item];
if (!this.children().length) {
fs.readdir(dir, function(err) {
if (err) watcherRemove(sysPath.dirname(dir), sysPath.basename(dir));
});
}
},
has: function(item) {return item in this._items;},
children: function() {return Object.keys(this._items);}
};
return this._watched[dir];
};
// File helpers
// ------------
// Private method: Check for read permissions
// Based on this answer on SO: http://stackoverflow.com/a/11781404/1358405
//
// * stats - object, result of fs.stat
//
// Returns boolean
FSWatcher.prototype._hasReadPermissions = function(stats) {
return Boolean(4 & parseInt(((stats && stats.mode) & 0x1ff).toString(8)[0], 10));
};
// Private method: Handles emitting unlink events for
// files and directories, and via recursion, for
// files and directories within directories that are unlinked
//
// * directory - string, directory within which the following item is located
// * item - string, base path of item/directory
//
// Returns nothing
FSWatcher.prototype._remove = function(directory, item) {
// if what is being deleted is a directory, get that directory's paths
// for recursive deleting and cleaning of watched object
// if it is not a directory, nestedDirectoryChildren will be empty array
var path = sysPath.join(directory, item);
var fullPath = sysPath.resolve(path);
var isDirectory = this._watched[path] || this._watched[fullPath];
// prevent duplicate handling in case of arriving here nearly simultaneously
// via multiple paths (such as _handleFile and _handleDir)
if (!this._throttle('remove', path, 100)) return;
// if the only watched file is removed, watch for its return
var watchedDirs = Object.keys(this._watched);
if (!isDirectory && !this.options.useFsEvents && watchedDirs.length === 1) {
this.add(directory, item, true);
}
// This will create a new entry in the watched object in either case
// so we got to do the directory check beforehand
var nestedDirectoryChildren = this._getWatchedDir(path).children();
// Recursively remove children directories / files.
nestedDirectoryChildren.forEach(function(nestedItem) {
this._remove(path, nestedItem);
}, this);
// Check if item was on the watched list and remove it
var parent = this._getWatchedDir(directory);
var wasTracked = parent.has(item);
parent.remove(item);
// If we wait for this file to be fully written, cancel the wait.
var relPath = path;
if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path);
if (this.options.awaitWriteFinish && this._pendingWrites[relPath]) {
var event = this._pendingWrites[relPath].cancelWait();
if (event === 'add') return;
}
// The Entry will either be a directory that just got removed
// or a bogus entry to a file, in either case we have to remove it
delete this._watched[path];
delete this._watched[fullPath];
var eventName = isDirectory ? 'unlinkDir' : 'unlink';
if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
// Avoid conflicts if we later create another file with the same name
if (!this.options.useFsEvents) {
this._closePath(path);
}
};
FSWatcher.prototype._closePath = function(path) {
if (!this._closers[path]) return;
this._closers[path].forEach(function(closer) {
closer();
});
delete this._closers[path];
this._getWatchedDir(sysPath.dirname(path)).remove(sysPath.basename(path));
}
// Public method: Adds paths to be watched on an existing FSWatcher instance
// * paths - string or array of strings, file/directory paths and/or globs
// * _origAdd - private boolean, for handling non-existent paths to be watched
// * _internal - private boolean, indicates a non-user add
// Returns an instance of FSWatcher for chaining.
FSWatcher.prototype.add = function(paths, _origAdd, _internal) {
var disableGlobbing = this.options.disableGlobbing;
var cwd = this.options.cwd;
this.closed = false;
paths = flatten(arrify(paths));
if (!paths.every(isString)) {
throw new TypeError('Non-string provided as watch path: ' + paths);
}
if (cwd) paths = paths.map(function(path) {
var absPath;
if (isAbsolute(path)) {
absPath = path;
} else if (path[0] === '!') {
absPath = '!' + sysPath.join(cwd, path.substring(1));
} else {
absPath = sysPath.join(cwd, path);
}
// Check `path` instead of `absPath` because the cwd portion can't be a glob
if (disableGlobbing || !isGlob(path)) {
return absPath;
} else {
return normalizePath(absPath);
}
});
// set aside negated glob strings
paths = paths.filter(function(path) {
if (path[0] === '!') {
this._ignoredPaths[path.substring(1)] = true;
} else {
// if a path is being added that was previously ignored, stop ignoring it
delete this._ignoredPaths[path];
delete this._ignoredPaths[path + '/**'];
// reset the cached userIgnored anymatch fn
// to make ignoredPaths changes effective
this._userIgnored = null;
return true;
}
}, this);
if (this.options.useFsEvents && FsEventsHandler.canUse()) {
if (!this._readyCount) this._readyCount = paths.length;
if (this.options.persistent) this._readyCount *= 2;
paths.forEach(this._addToFsEvents, this);
} else {
if (!this._readyCount) this._readyCount = 0;
this._readyCount += paths.length;
asyncEach(paths, function(path, next) {
this._addToNodeFs(path, !_internal, 0, 0, _origAdd, function(err, res) {
if (res) this._emitReady();
next(err, res);
}.bind(this));
}.bind(this), function(error, results) {
results.forEach(function(item) {
if (!item || this.closed) return;
this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
}, this);
}.bind(this));
}
return this;
};
// Public method: Close watchers or start ignoring events from specified paths.
// * paths - string or array of strings, file/directory paths and/or globs
// Returns instance of FSWatcher for chaining.
FSWatcher.prototype.unwatch = function(paths) {
if (this.closed) return this;
paths = flatten(arrify(paths));
paths.forEach(function(path) {
// convert to absolute path unless relative path already matches
if (!isAbsolute(path) && !this._closers[path]) {
if (this.options.cwd) path = sysPath.join(this.options.cwd, path);
path = sysPath.resolve(path);
}
this._closePath(path);
this._ignoredPaths[path] = true;
if (path in this._watched) {
this._ignoredPaths[path + '/**'] = true;
}
// reset the cached userIgnored anymatch fn
// to make ignoredPaths changes effective
this._userIgnored = null;
}, this);
return this;
};
// Public method: Close watchers and remove all listeners from watched paths.
// Returns instance of FSWatcher for chaining.
FSWatcher.prototype.close = function() {
if (this.closed) return this;
this.closed = true;
Object.keys(this._closers).forEach(function(watchPath) {
this._closers[watchPath].forEach(function(closer) {
closer();
});
delete this._closers[watchPath];
}, this);
this._watched = Object.create(null);
this.removeAllListeners();
return this;
};
// Public method: Expose list of watched paths
// Returns object w/ dir paths as keys and arrays of contained paths as values.
FSWatcher.prototype.getWatched = function() {
var watchList = {};
Object.keys(this._watched).forEach(function(dir) {
var key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
watchList[key || '.'] = Object.keys(this._watched[dir]._items).sort();
}.bind(this));
return watchList;
};
// Attach watch handler prototype methods
function importHandler(handler) {
Object.keys(handler.prototype).forEach(function(method) {
FSWatcher.prototype[method] = handler.prototype[method];
});
}
importHandler(NodeFsHandler);
if (FsEventsHandler.canUse()) importHandler(FsEventsHandler);
// Export FSWatcher class
exports.FSWatcher = FSWatcher;
// Public function: Instantiates watcher with paths to be tracked.
// * paths - string or array of strings, file/directory paths and/or globs
// * options - object, chokidar options
// Returns an instance of FSWatcher for chaining.
exports.watch = function(paths, options) {
return new FSWatcher(options).add(paths);
};

View File

@ -0,0 +1,412 @@
'use strict';
var fs = require('fs');
var sysPath = require('path');
var readdirp = require('readdirp');
var fsevents;
try { fsevents = require('fsevents'); } catch (error) {
if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error)
}
// fsevents instance helper functions
// object to hold per-process fsevents instances
// (may be shared across chokidar FSWatcher instances)
var FSEventsWatchers = Object.create(null);
// Threshold of duplicate path prefixes at which to start
// consolidating going forward
var consolidateThreshhold = 10;
// Private function: Instantiates the fsevents interface
// * path - string, path to be watched
// * callback - function, called when fsevents is bound and ready
// Returns new fsevents instance
function createFSEventsInstance(path, callback) {
return (new fsevents(path)).on('fsevent', callback).start();
}
// Private function: Instantiates the fsevents interface or binds listeners
// to an existing one covering the same file tree
// * path - string, path to be watched
// * realPath - string, real path (in case of symlinks)
// * listener - function, called when fsevents emits events
// * rawEmitter - function, passes data to listeners of the 'raw' event
// Returns close function
function setFSEventsListener(path, realPath, listener, rawEmitter) {
var watchPath = sysPath.extname(path) ? sysPath.dirname(path) : path;
var watchContainer;
var parentPath = sysPath.dirname(watchPath);
// If we've accumulated a substantial number of paths that
// could have been consolidated by watching one directory
// above the current one, create a watcher on the parent
// path instead, so that we do consolidate going forward.
if (couldConsolidate(parentPath)) {
watchPath = parentPath;
}
var resolvedPath = sysPath.resolve(path);
var hasSymlink = resolvedPath !== realPath;
function filteredListener(fullPath, flags, info) {
if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath);
if (
fullPath === resolvedPath ||
!fullPath.indexOf(resolvedPath + sysPath.sep)
) listener(fullPath, flags, info);
}
// check if there is already a watcher on a parent path
// modifies `watchPath` to the parent path when it finds a match
function watchedParent() {
return Object.keys(FSEventsWatchers).some(function(watchedPath) {
// condition is met when indexOf returns 0
if (!realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep)) {
watchPath = watchedPath;
return true;
}
});
}
if (watchPath in FSEventsWatchers || watchedParent()) {
watchContainer = FSEventsWatchers[watchPath];
watchContainer.listeners.push(filteredListener);
} else {
watchContainer = FSEventsWatchers[watchPath] = {
listeners: [filteredListener],
rawEmitters: [rawEmitter],
watcher: createFSEventsInstance(watchPath, function(fullPath, flags) {
var info = fsevents.getInfo(fullPath, flags);
watchContainer.listeners.forEach(function(listener) {
listener(fullPath, flags, info);
});
watchContainer.rawEmitters.forEach(function(emitter) {
emitter(info.event, fullPath, info);
});
})
};
}
var listenerIndex = watchContainer.listeners.length - 1;
// removes this instance's listeners and closes the underlying fsevents
// instance if there are no more listeners left
return function close() {
delete watchContainer.listeners[listenerIndex];
delete watchContainer.rawEmitters[listenerIndex];
if (!Object.keys(watchContainer.listeners).length) {
watchContainer.watcher.stop();
delete FSEventsWatchers[watchPath];
}
};
}
// Decide whether or not we should start a new higher-level
// parent watcher
function couldConsolidate(path) {
var keys = Object.keys(FSEventsWatchers);
var count = 0;
for (var i = 0, len = keys.length; i < len; ++i) {
var watchPath = keys[i];
if (watchPath.indexOf(path) === 0) {
count++;
if (count >= consolidateThreshhold) {
return true;
}
}
}
return false;
}
function isConstructor(obj) {
return obj.prototype !== undefined && obj.prototype.constructor !== undefined;
}
// returns boolean indicating whether fsevents can be used
function canUse() {
return fsevents && Object.keys(FSEventsWatchers).length < 128 && isConstructor(fsevents);
}
// determines subdirectory traversal levels from root to path
function depth(path, root) {
var i = 0;
while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++;
return i;
}
// fake constructor for attaching fsevents-specific prototype methods that
// will be copied to FSWatcher's prototype
function FsEventsHandler() {}
// Private method: Handle symlinks encountered during directory scan
// * watchPath - string, file/dir path to be watched with fsevents
// * realPath - string, real path (in case of symlinks)
// * transform - function, path transformer
// * globFilter - function, path filter in case a glob pattern was provided
// Returns close function for the watcher instance
FsEventsHandler.prototype._watchWithFsEvents =
function(watchPath, realPath, transform, globFilter) {
if (this._isIgnored(watchPath)) return;
var watchCallback = function(fullPath, flags, info) {
if (
this.options.depth !== undefined &&
depth(fullPath, realPath) > this.options.depth
) return;
var path = transform(sysPath.join(
watchPath, sysPath.relative(watchPath, fullPath)
));
if (globFilter && !globFilter(path)) return;
// ensure directories are tracked
var parent = sysPath.dirname(path);
var item = sysPath.basename(path);
var watchedDir = this._getWatchedDir(
info.type === 'directory' ? path : parent
);
var checkIgnored = function(stats) {
if (this._isIgnored(path, stats)) {
this._ignoredPaths[path] = true;
if (stats && stats.isDirectory()) {
this._ignoredPaths[path + '/**/*'] = true;
}
return true;
} else {
delete this._ignoredPaths[path];
delete this._ignoredPaths[path + '/**/*'];
}
}.bind(this);
var handleEvent = function(event) {
if (checkIgnored()) return;
if (event === 'unlink') {
// suppress unlink events on never before seen files
if (info.type === 'directory' || watchedDir.has(item)) {
this._remove(parent, item);
}
} else {
if (event === 'add') {
// track new directories
if (info.type === 'directory') this._getWatchedDir(path);
if (info.type === 'symlink' && this.options.followSymlinks) {
// push symlinks back to the top of the stack to get handled
var curDepth = this.options.depth === undefined ?
undefined : depth(fullPath, realPath) + 1;
return this._addToFsEvents(path, false, true, curDepth);
} else {
// track new paths
// (other than symlinks being followed, which will be tracked soon)
this._getWatchedDir(parent).add(item);
}
}
var eventName = info.type === 'directory' ? event + 'Dir' : event;
this._emit(eventName, path);
if (eventName === 'addDir') this._addToFsEvents(path, false, true);
}
}.bind(this);
function addOrChange() {
handleEvent(watchedDir.has(item) ? 'change' : 'add');
}
function checkFd() {
fs.open(path, 'r', function(error, fd) {
if (error) {
error.code !== 'EACCES' ?
handleEvent('unlink') : addOrChange();
} else {
fs.close(fd, function(err) {
err && err.code !== 'EACCES' ?
handleEvent('unlink') : addOrChange();
});
}
});
}
// correct for wrong events emitted
var wrongEventFlags = [
69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912
];
if (wrongEventFlags.indexOf(flags) !== -1 || info.event === 'unknown') {
if (typeof this.options.ignored === 'function') {
fs.stat(path, function(error, stats) {
if (checkIgnored(stats)) return;
stats ? addOrChange() : handleEvent('unlink');
});
} else {
checkFd();
}
} else {
switch (info.event) {
case 'created':
case 'modified':
return addOrChange();
case 'deleted':
case 'moved':
return checkFd();
}
}
}.bind(this);
var closer = setFSEventsListener(
watchPath,
realPath,
watchCallback,
this.emit.bind(this, 'raw')
);
this._emitReady();
return closer;
};
// Private method: Handle symlinks encountered during directory scan
// * linkPath - string, path to symlink
// * fullPath - string, absolute path to the symlink
// * transform - function, pre-existing path transformer
// * curDepth - int, level of subdirectories traversed to where symlink is
// Returns nothing
FsEventsHandler.prototype._handleFsEventsSymlink =
function(linkPath, fullPath, transform, curDepth) {
// don't follow the same symlink more than once
if (this._symlinkPaths[fullPath]) return;
else this._symlinkPaths[fullPath] = true;
this._readyCount++;
fs.realpath(linkPath, function(error, linkTarget) {
if (this._handleError(error) || this._isIgnored(linkTarget)) {
return this._emitReady();
}
this._readyCount++;
// add the linkTarget for watching with a wrapper for transform
// that causes emitted paths to incorporate the link's path
this._addToFsEvents(linkTarget || linkPath, function(path) {
var dotSlash = '.' + sysPath.sep;
var aliasedPath = linkPath;
if (linkTarget && linkTarget !== dotSlash) {
aliasedPath = path.replace(linkTarget, linkPath);
} else if (path !== dotSlash) {
aliasedPath = sysPath.join(linkPath, path);
}
return transform(aliasedPath);
}, false, curDepth);
}.bind(this));
};
// Private method: Handle added path with fsevents
// * path - string, file/directory path or glob pattern
// * transform - function, converts working path to what the user expects
// * forceAdd - boolean, ensure add is emitted
// * priorDepth - int, level of subdirectories already traversed
// Returns nothing
FsEventsHandler.prototype._addToFsEvents =
function(path, transform, forceAdd, priorDepth) {
// applies transform if provided, otherwise returns same value
var processPath = typeof transform === 'function' ?
transform : function(val) { return val; };
var emitAdd = function(newPath, stats) {
var pp = processPath(newPath);
var isDir = stats.isDirectory();
var dirObj = this._getWatchedDir(sysPath.dirname(pp));
var base = sysPath.basename(pp);
// ensure empty dirs get tracked
if (isDir) this._getWatchedDir(pp);
if (dirObj.has(base)) return;
dirObj.add(base);
if (!this.options.ignoreInitial || forceAdd === true) {
this._emit(isDir ? 'addDir' : 'add', pp, stats);
}
}.bind(this);
var wh = this._getWatchHelpers(path);
// evaluate what is at the path we're being asked to watch
fs[wh.statMethod](wh.watchPath, function(error, stats) {
if (this._handleError(error) || this._isIgnored(wh.watchPath, stats)) {
this._emitReady();
return this._emitReady();
}
if (stats.isDirectory()) {
// emit addDir unless this is a glob parent
if (!wh.globFilter) emitAdd(processPath(path), stats);
// don't recurse further if it would exceed depth setting
if (priorDepth && priorDepth > this.options.depth) return;
// scan the contents of the dir
readdirp({
root: wh.watchPath,
entryType: 'all',
fileFilter: wh.filterPath,
directoryFilter: wh.filterDir,
lstat: true,
depth: this.options.depth - (priorDepth || 0)
}).on('data', function(entry) {
// need to check filterPath on dirs b/c filterDir is less restrictive
if (entry.stat.isDirectory() && !wh.filterPath(entry)) return;
var joinedPath = sysPath.join(wh.watchPath, entry.path);
var fullPath = entry.fullPath;
if (wh.followSymlinks && entry.stat.isSymbolicLink()) {
// preserve the current depth here since it can't be derived from
// real paths past the symlink
var curDepth = this.options.depth === undefined ?
undefined : depth(joinedPath, sysPath.resolve(wh.watchPath)) + 1;
this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth);
} else {
emitAdd(joinedPath, entry.stat);
}
}.bind(this)).on('error', function() {
// Ignore readdirp errors
}).on('end', this._emitReady);
} else {
emitAdd(wh.watchPath, stats);
this._emitReady();
}
}.bind(this));
if (this.options.persistent && forceAdd !== true) {
var initWatch = function(error, realPath) {
if (this.closed) return;
var closer = this._watchWithFsEvents(
wh.watchPath,
sysPath.resolve(realPath || wh.watchPath),
processPath,
wh.globFilter
);
if (closer) {
this._closers[path] = this._closers[path] || [];
this._closers[path].push(closer);
}
}.bind(this);
if (typeof transform === 'function') {
// realpath has already been resolved
initWatch();
} else {
fs.realpath(wh.watchPath, initWatch);
}
}
};
module.exports = FsEventsHandler;
module.exports.canUse = canUse;

View File

@ -0,0 +1,506 @@
'use strict';
var fs = require('fs');
var sysPath = require('path');
var readdirp = require('readdirp');
var isBinaryPath = require('is-binary-path');
// fs.watch helpers
// object to hold per-process fs.watch instances
// (may be shared across chokidar FSWatcher instances)
var FsWatchInstances = Object.create(null);
// Private function: Instantiates the fs.watch interface
// * path - string, path to be watched
// * options - object, options to be passed to fs.watch
// * listener - function, main event handler
// * errHandler - function, handler which emits info about errors
// * emitRaw - function, handler which emits raw event data
// Returns new fsevents instance
function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
var handleEvent = function(rawEvent, evPath) {
listener(path);
emitRaw(rawEvent, evPath, {watchedPath: path});
// emit based on events occurring for files from a directory's watcher in
// case the file's watcher misses it (and rely on throttling to de-dupe)
if (evPath && path !== evPath) {
fsWatchBroadcast(
sysPath.resolve(path, evPath), 'listeners', sysPath.join(path, evPath)
);
}
};
try {
return fs.watch(path, options, handleEvent);
} catch (error) {
errHandler(error);
}
}
// Private function: Helper for passing fs.watch event data to a
// collection of listeners
// * fullPath - string, absolute path bound to the fs.watch instance
// * type - string, listener type
// * val[1..3] - arguments to be passed to listeners
// Returns nothing
function fsWatchBroadcast(fullPath, type, val1, val2, val3) {
if (!FsWatchInstances[fullPath]) return;
FsWatchInstances[fullPath][type].forEach(function(listener) {
listener(val1, val2, val3);
});
}
// Private function: Instantiates the fs.watch interface or binds listeners
// to an existing one covering the same file system entry
// * path - string, path to be watched
// * fullPath - string, absolute path
// * options - object, options to be passed to fs.watch
// * handlers - object, container for event listener functions
// Returns close function
function setFsWatchListener(path, fullPath, options, handlers) {
var listener = handlers.listener;
var errHandler = handlers.errHandler;
var rawEmitter = handlers.rawEmitter;
var container = FsWatchInstances[fullPath];
var watcher;
if (!options.persistent) {
watcher = createFsWatchInstance(
path, options, listener, errHandler, rawEmitter
);
return watcher.close.bind(watcher);
}
if (!container) {
watcher = createFsWatchInstance(
path,
options,
fsWatchBroadcast.bind(null, fullPath, 'listeners'),
errHandler, // no need to use broadcast here
fsWatchBroadcast.bind(null, fullPath, 'rawEmitters')
);
if (!watcher) return;
var broadcastErr = fsWatchBroadcast.bind(null, fullPath, 'errHandlers');
watcher.on('error', function(error) {
container.watcherUnusable = true; // documented since Node 10.4.1
// Workaround for https://github.com/joyent/node/issues/4337
if (process.platform === 'win32' && error.code === 'EPERM') {
fs.open(path, 'r', function(err, fd) {
if (!err) fs.close(fd, function(err) {
if (!err) broadcastErr(error);
});
});
} else {
broadcastErr(error);
}
});
container = FsWatchInstances[fullPath] = {
listeners: [listener],
errHandlers: [errHandler],
rawEmitters: [rawEmitter],
watcher: watcher
};
} else {
container.listeners.push(listener);
container.errHandlers.push(errHandler);
container.rawEmitters.push(rawEmitter);
}
var listenerIndex = container.listeners.length - 1;
// removes this instance's listeners and closes the underlying fs.watch
// instance if there are no more listeners left
return function close() {
delete container.listeners[listenerIndex];
delete container.errHandlers[listenerIndex];
delete container.rawEmitters[listenerIndex];
if (!Object.keys(container.listeners).length) {
if (!container.watcherUnusable) { // check to protect against issue #730
container.watcher.close();
}
delete FsWatchInstances[fullPath];
}
};
}
// fs.watchFile helpers
// object to hold per-process fs.watchFile instances
// (may be shared across chokidar FSWatcher instances)
var FsWatchFileInstances = Object.create(null);
// Private function: Instantiates the fs.watchFile interface or binds listeners
// to an existing one covering the same file system entry
// * path - string, path to be watched
// * fullPath - string, absolute path
// * options - object, options to be passed to fs.watchFile
// * handlers - object, container for event listener functions
// Returns close function
function setFsWatchFileListener(path, fullPath, options, handlers) {
var listener = handlers.listener;
var rawEmitter = handlers.rawEmitter;
var container = FsWatchFileInstances[fullPath];
var listeners = [];
var rawEmitters = [];
if (
container && (
container.options.persistent < options.persistent ||
container.options.interval > options.interval
)
) {
// "Upgrade" the watcher to persistence or a quicker interval.
// This creates some unlikely edge case issues if the user mixes
// settings in a very weird way, but solving for those cases
// doesn't seem worthwhile for the added complexity.
listeners = container.listeners;
rawEmitters = container.rawEmitters;
fs.unwatchFile(fullPath);
container = false;
}
if (!container) {
listeners.push(listener);
rawEmitters.push(rawEmitter);
container = FsWatchFileInstances[fullPath] = {
listeners: listeners,
rawEmitters: rawEmitters,
options: options,
watcher: fs.watchFile(fullPath, options, function(curr, prev) {
container.rawEmitters.forEach(function(rawEmitter) {
rawEmitter('change', fullPath, {curr: curr, prev: prev});
});
var currmtime = curr.mtime.getTime();
if (curr.size !== prev.size || currmtime > prev.mtime.getTime() || currmtime === 0) {
container.listeners.forEach(function(listener) {
listener(path, curr);
});
}
})
};
} else {
container.listeners.push(listener);
container.rawEmitters.push(rawEmitter);
}
var listenerIndex = container.listeners.length - 1;
// removes this instance's listeners and closes the underlying fs.watchFile
// instance if there are no more listeners left
return function close() {
delete container.listeners[listenerIndex];
delete container.rawEmitters[listenerIndex];
if (!Object.keys(container.listeners).length) {
fs.unwatchFile(fullPath);
delete FsWatchFileInstances[fullPath];
}
};
}
// fake constructor for attaching nodefs-specific prototype methods that
// will be copied to FSWatcher's prototype
function NodeFsHandler() {}
// Private method: Watch file for changes with fs.watchFile or fs.watch.
// * path - string, path to file or directory.
// * listener - function, to be executed on fs change.
// Returns close function for the watcher instance
NodeFsHandler.prototype._watchWithNodeFs =
function(path, listener) {
var directory = sysPath.dirname(path);
var basename = sysPath.basename(path);
var parent = this._getWatchedDir(directory);
parent.add(basename);
var absolutePath = sysPath.resolve(path);
var options = {persistent: this.options.persistent};
if (!listener) listener = Function.prototype; // empty function
var closer;
if (this.options.usePolling) {
options.interval = this.enableBinaryInterval && isBinaryPath(basename) ?
this.options.binaryInterval : this.options.interval;
closer = setFsWatchFileListener(path, absolutePath, options, {
listener: listener,
rawEmitter: this.emit.bind(this, 'raw')
});
} else {
closer = setFsWatchListener(path, absolutePath, options, {
listener: listener,
errHandler: this._handleError.bind(this),
rawEmitter: this.emit.bind(this, 'raw')
});
}
return closer;
};
// Private method: Watch a file and emit add event if warranted
// * file - string, the file's path
// * stats - object, result of fs.stat
// * initialAdd - boolean, was the file added at watch instantiation?
// * callback - function, called when done processing as a newly seen file
// Returns close function for the watcher instance
NodeFsHandler.prototype._handleFile =
function(file, stats, initialAdd, callback) {
var dirname = sysPath.dirname(file);
var basename = sysPath.basename(file);
var parent = this._getWatchedDir(dirname);
// stats is always present
var prevStats = stats;
// if the file is already being watched, do nothing
if (parent.has(basename)) return callback();
// kick off the watcher
var closer = this._watchWithNodeFs(file, function(path, newStats) {
if (!this._throttle('watch', file, 5)) return;
if (!newStats || newStats && newStats.mtime.getTime() === 0) {
fs.stat(file, function(error, newStats) {
// Fix issues where mtime is null but file is still present
if (error) {
this._remove(dirname, basename);
} else {
// Check that change event was not fired because of changed only accessTime.
var at = newStats.atime.getTime();
var mt = newStats.mtime.getTime();
if (!at || at <= mt || mt !== prevStats.mtime.getTime()) {
this._emit('change', file, newStats);
}
prevStats = newStats;
}
}.bind(this));
// add is about to be emitted if file not already tracked in parent
} else if (parent.has(basename)) {
// Check that change event was not fired because of changed only accessTime.
var at = newStats.atime.getTime();
var mt = newStats.mtime.getTime();
if (!at || at <= mt || mt !== prevStats.mtime.getTime()) {
this._emit('change', file, newStats);
}
prevStats = newStats;
}
}.bind(this));
// emit an add event if we're supposed to
if (!(initialAdd && this.options.ignoreInitial)) {
if (!this._throttle('add', file, 0)) return;
this._emit('add', file, stats);
}
if (callback) callback();
return closer;
};
// Private method: Handle symlinks encountered while reading a dir
// * entry - object, entry object returned by readdirp
// * directory - string, path of the directory being read
// * path - string, path of this item
// * item - string, basename of this item
// Returns true if no more processing is needed for this entry.
NodeFsHandler.prototype._handleSymlink =
function(entry, directory, path, item) {
var full = entry.fullPath;
var dir = this._getWatchedDir(directory);
if (!this.options.followSymlinks) {
// watch symlink directly (don't follow) and detect changes
this._readyCount++;
fs.realpath(path, function(error, linkPath) {
if (dir.has(item)) {
if (this._symlinkPaths[full] !== linkPath) {
this._symlinkPaths[full] = linkPath;
this._emit('change', path, entry.stat);
}
} else {
dir.add(item);
this._symlinkPaths[full] = linkPath;
this._emit('add', path, entry.stat);
}
this._emitReady();
}.bind(this));
return true;
}
// don't follow the same symlink more than once
if (this._symlinkPaths[full]) return true;
else this._symlinkPaths[full] = true;
};
// Private method: Read directory to add / remove files from `@watched` list
// and re-read it on change.
// * dir - string, fs path.
// * stats - object, result of fs.stat
// * initialAdd - boolean, was the file added at watch instantiation?
// * depth - int, depth relative to user-supplied path
// * target - string, child path actually targeted for watch
// * wh - object, common watch helpers for this path
// * callback - function, called when dir scan is complete
// Returns close function for the watcher instance
NodeFsHandler.prototype._handleDir =
function(dir, stats, initialAdd, depth, target, wh, callback) {
var parentDir = this._getWatchedDir(sysPath.dirname(dir));
var tracked = parentDir.has(sysPath.basename(dir));
if (!(initialAdd && this.options.ignoreInitial) && !target && !tracked) {
if (!wh.hasGlob || wh.globFilter(dir)) this._emit('addDir', dir, stats);
}
// ensure dir is tracked (harmless if redundant)
parentDir.add(sysPath.basename(dir));
this._getWatchedDir(dir);
var read = function(directory, initialAdd, done) {
// Normalize the directory name on Windows
directory = sysPath.join(directory, '');
if (!wh.hasGlob) {
var throttler = this._throttle('readdir', directory, 1000);
if (!throttler) return;
}
var previous = this._getWatchedDir(wh.path);
var current = [];
readdirp({
root: directory,
entryType: 'all',
fileFilter: wh.filterPath,
directoryFilter: wh.filterDir,
depth: 0,
lstat: true
}).on('data', function(entry) {
var item = entry.path;
var path = sysPath.join(directory, item);
current.push(item);
if (entry.stat.isSymbolicLink() &&
this._handleSymlink(entry, directory, path, item)) return;
// Files that present in current directory snapshot
// but absent in previous are added to watch list and
// emit `add` event.
if (item === target || !target && !previous.has(item)) {
this._readyCount++;
// ensure relativeness of path is preserved in case of watcher reuse
path = sysPath.join(dir, sysPath.relative(dir, path));
this._addToNodeFs(path, initialAdd, wh, depth + 1);
}
}.bind(this)).on('end', function() {
var wasThrottled = throttler ? throttler.clear() : false;
if (done) done();
// Files that absent in current directory snapshot
// but present in previous emit `remove` event
// and are removed from @watched[directory].
previous.children().filter(function(item) {
return item !== directory &&
current.indexOf(item) === -1 &&
// in case of intersecting globs;
// a path may have been filtered out of this readdir, but
// shouldn't be removed because it matches a different glob
(!wh.hasGlob || wh.filterPath({
fullPath: sysPath.resolve(directory, item)
}));
}).forEach(function(item) {
this._remove(directory, item);
}, this);
// one more time for any missed in case changes came in extremely quickly
if (wasThrottled) read(directory, false);
}.bind(this)).on('error', this._handleError.bind(this));
}.bind(this);
var closer;
if (this.options.depth == null || depth <= this.options.depth) {
if (!target) read(dir, initialAdd, callback);
closer = this._watchWithNodeFs(dir, function(dirPath, stats) {
// if current directory is removed, do nothing
if (stats && stats.mtime.getTime() === 0) return;
read(dirPath, false);
});
} else {
callback();
}
return closer;
};
// Private method: Handle added file, directory, or glob pattern.
// Delegates call to _handleFile / _handleDir after checks.
// * path - string, path to file or directory.
// * initialAdd - boolean, was the file added at watch instantiation?
// * depth - int, depth relative to user-supplied path
// * target - string, child path actually targeted for watch
// * callback - function, indicates whether the path was found or not
// Returns nothing
NodeFsHandler.prototype._addToNodeFs =
function(path, initialAdd, priorWh, depth, target, callback) {
if (!callback) callback = Function.prototype;
var ready = this._emitReady;
if (this._isIgnored(path) || this.closed) {
ready();
return callback(null, false);
}
var wh = this._getWatchHelpers(path, depth);
if (!wh.hasGlob && priorWh) {
wh.hasGlob = priorWh.hasGlob;
wh.globFilter = priorWh.globFilter;
wh.filterPath = priorWh.filterPath;
wh.filterDir = priorWh.filterDir;
}
// evaluate what is at the path we're being asked to watch
fs[wh.statMethod](wh.watchPath, function(error, stats) {
if (this._handleError(error)) return callback(null, path);
if (this._isIgnored(wh.watchPath, stats)) {
ready();
return callback(null, false);
}
var initDir = function(dir, target) {
return this._handleDir(dir, stats, initialAdd, depth, target, wh, ready);
}.bind(this);
var closer;
if (stats.isDirectory()) {
closer = initDir(wh.watchPath, target);
} else if (stats.isSymbolicLink()) {
var parent = sysPath.dirname(wh.watchPath);
this._getWatchedDir(parent).add(wh.watchPath);
this._emit('add', wh.watchPath, stats);
closer = initDir(parent, path);
// preserve this symlink's target path
fs.realpath(path, function(error, targetPath) {
this._symlinkPaths[sysPath.resolve(path)] = targetPath;
ready();
}.bind(this));
} else {
closer = this._handleFile(wh.watchPath, stats, initialAdd, ready);
}
if (closer) {
this._closers[path] = this._closers[path] || [];
this._closers[path].push(closer);
}
callback(null, false);
}.bind(this));
};
module.exports = NodeFsHandler;

View File

@ -0,0 +1,96 @@
{
"_args": [
[
"chokidar@2.1.8",
"/Users/tatiana/selfdefined"
]
],
"_from": "chokidar@2.1.8",
"_id": "chokidar@2.1.8",
"_inBundle": false,
"_integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==",
"_location": "/nunjucks/chokidar",
"_optional": true,
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "chokidar@2.1.8",
"name": "chokidar",
"escapedName": "chokidar",
"rawSpec": "2.1.8",
"saveSpec": null,
"fetchSpec": "2.1.8"
},
"_requiredBy": [
"/nunjucks"
],
"_resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz",
"_spec": "2.1.8",
"_where": "/Users/tatiana/selfdefined",
"author": {
"name": "Paul Miller",
"url": "https://paulmillr.com"
},
"bugs": {
"url": "https://github.com/paulmillr/chokidar/issues"
},
"dependencies": {
"anymatch": "^2.0.0",
"async-each": "^1.0.1",
"braces": "^2.3.2",
"fsevents": "^1.2.7",
"glob-parent": "^3.1.0",
"inherits": "^2.0.3",
"is-binary-path": "^1.0.0",
"is-glob": "^4.0.0",
"normalize-path": "^3.0.0",
"path-is-absolute": "^1.0.0",
"readdirp": "^2.2.1",
"upath": "^1.1.1"
},
"description": "A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.",
"devDependencies": {
"@types/node": "^11.9.4",
"chai": "^3.2.0",
"coveralls": "^3.0.1",
"dtslint": "0.4.1",
"graceful-fs": "4.1.4",
"mocha": "^5.2.0",
"nyc": "^11.8.0",
"rimraf": "^2.4.3",
"sinon": "^1.10.3",
"sinon-chai": "^2.6.0"
},
"files": [
"index.js",
"lib/",
"types/index.d.ts"
],
"homepage": "https://github.com/paulmillr/chokidar",
"keywords": [
"fs",
"watch",
"watchFile",
"watcher",
"watching",
"file",
"fsevents"
],
"license": "MIT",
"name": "chokidar",
"optionalDependencies": {
"fsevents": "^1.2.7"
},
"repository": {
"type": "git",
"url": "git+https://github.com/paulmillr/chokidar.git"
},
"scripts": {
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"dtslint": "dtslint types",
"test": "nyc mocha --exit"
},
"types": "./types/index.d.ts",
"version": "2.1.8"
}

View File

@ -0,0 +1,191 @@
// TypeScript Version: 3.0
/// <reference types="node" />
import * as fs from "fs";
import { EventEmitter } from "events";
/**
* The object's keys are all the directories (using absolute paths unless the `cwd` option was
* used), and the values are arrays of the names of the items contained in each directory.
*/
export interface WatchedPaths {
[directory: string]: string[];
}
export class FSWatcher extends EventEmitter implements fs.FSWatcher {
/**
* Constructs a new FSWatcher instance with optional WatchOptions parameter.
*/
constructor(options?: WatchOptions);
/**
* Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
* string.
*/
add(paths: string | string[]): void;
/**
* Stop watching files, directories, or glob patterns. Takes an array of strings or just one
* string.
*/
unwatch(paths: string | string[]): void;
/**
* Returns an object representing all the paths on the file system being watched by this
* `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
* the `cwd` option was used), and the values are arrays of the names of the items contained in
* each directory.
*/
getWatched(): WatchedPaths;
/**
* Removes all listeners from watched files.
*/
close(): void;
on(event: 'add'|'addDir'|'change', listener: (path: string, stats?: fs.Stats) => void): this;
on(event: 'all', listener: (eventName: 'add'|'addDir'|'change'|'unlink'|'unlinkDir', path: string, stats?: fs.Stats) => void): this;
/**
* Error occured
*/
on(event: 'error', listener: (error: Error) => void): this;
/**
* Exposes the native Node `fs.FSWatcher events`
*/
on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this;
/**
* Fires when the initial scan is complete
*/
on(event: 'ready', listener: () => void): this;
on(event: 'unlink'|'unlinkDir', listener: (path: string) => void): this;
on(event: string, listener: (...args: any[]) => void): this;
}
export interface WatchOptions {
/**
* Indicates whether the process should continue to run as long as files are being watched. If
* set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
* even if the process continues to run.
*/
persistent?: boolean;
/**
* ([anymatch](https://github.com/es128/anymatch)-compatible definition) Defines files/paths to
* be ignored. The whole relative or absolute path is tested, not just filename. If a function
* with two arguments is provided, it gets called twice per path - once with a single argument
* (the path), second time with two arguments (the path and the
* [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
*/
ignored?: any;
/**
* If set to `false` then `add`/`addDir` events are also emitted for matching paths while
* instantiating the watching as chokidar discovers these file paths (before the `ready` event).
*/
ignoreInitial?: boolean;
/**
* When `false`, only the symlinks themselves will be watched for changes instead of following
* the link references and bubbling events through the link's path.
*/
followSymlinks?: boolean;
/**
* The base directory from which watch `paths` are to be derived. Paths emitted with events will
* be relative to this.
*/
cwd?: string;
/**
* If set to true then the strings passed to .watch() and .add() are treated as literal path
* names, even if they look like globs. Default: false.
*/
disableGlobbing?: boolean;
/**
* Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
* utilization, consider setting this to `false`. It is typically necessary to **set this to
* `true` to successfully watch files over a network**, and it may be necessary to successfully
* watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
* the `useFsEvents` default.
*/
usePolling?: boolean;
/**
* Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
* and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on
* OS X, `usePolling: true` becomes the default.
*/
useFsEvents?: boolean;
/**
* If relying upon the [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object that
* may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
* provided even in cases where it wasn't already available from the underlying watch events.
*/
alwaysStat?: boolean;
/**
* If set, limits how many levels of subdirectories will be traversed.
*/
depth?: number;
/**
* Interval of file system polling.
*/
interval?: number;
/**
* Interval of file system polling for binary files. ([see list of binary extensions](https://gi
* thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
*/
binaryInterval?: number;
/**
* Indicates whether to watch files that don't have read permissions if possible. If watching
* fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
* silently.
*/
ignorePermissionErrors?: boolean;
/**
* `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts
* that occur when using editors that use "atomic writes" instead of writing directly to the
* source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
* event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
* you can override it by setting `atomic` to a custom value, in milliseconds.
*/
atomic?: boolean | number;
/**
* can be set to an object in order to adjust timing params:
*/
awaitWriteFinish?: AwaitWriteFinishOptions | boolean;
}
export interface AwaitWriteFinishOptions {
/**
* Amount of time in milliseconds for a file size to remain constant before emitting its event.
*/
stabilityThreshold?: number;
/**
* File size polling interval.
*/
pollInterval?: number;
}
/**
* produces an instance of `FSWatcher`.
*/
export function watch(
paths: string | string[],
options?: WatchOptions
): FSWatcher;

21
node_modules/nunjucks/node_modules/window-size/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015, Jon Schlinkert.
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,45 @@
# window-size [![NPM version](https://badge.fury.io/js/window-size.svg)](http://badge.fury.io/js/window-size) [![Build Status](https://travis-ci.org/jonschlinkert/window-size.svg)](https://travis-ci.org/jonschlinkert/window-size)
> Reliable way to to get the height and width of the terminal/console in a node.js environment.
## Install
Install with [npm](https://www.npmjs.com/)
```sh
$ npm i window-size --save
```
## Usage
```js
var size = require('window-size');
size.height; // "25" (rows)
size.width; // "80" (columns)
```
## Other projects
* [base-cli](https://www.npmjs.com/package/base-cli): Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a… [more](https://www.npmjs.com/package/base-cli) | [homepage](https://github.com/jonschlinkert/base-cli)
* [lint-deps](https://www.npmjs.com/package/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://www.npmjs.com/package/lint-deps) | [homepage](https://github.com/jonschlinkert/lint-deps)
* [yargs](https://www.npmjs.com/package/yargs): Light-weight option parsing with an argv hash. No optstrings attached. | [homepage](https://github.com/bcoe/yargs#readme)
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/window-size/issues/new).
## Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright © 2014-2015 [Jon Schlinkert](https://github.com/jonschlinkert)
Released under the MIT license.
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 15, 2015._

30
node_modules/nunjucks/node_modules/window-size/cli.js generated vendored Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env node
'use strict';
var helpText = ['Usage',
' $ window-size',
'',
'Example',
' $ window-size',
' height: 40 ',
' width : 145',
''].join('\n');
function showSize () {
var size = require('./');
console.log('height: ' + size.height);
console.log('width : ' + size.width);
}
if (process.argv.length > 2) {
switch (process.argv[2]) {
case 'help':
case '--help':
case '-h':
console.log(helpText);
break;
default:
showSize();
}
} else {
showSize();
}

View File

@ -0,0 +1,32 @@
'use strict';
/*!
* window-size <https://github.com/jonschlinkert/window-size>
*
* Copyright (c) 2014-2015 Jon Schlinkert
* Licensed under the MIT license.
*/
var tty = require('tty');
module.exports = (function () {
var width;
var height;
if (tty.isatty(1) && tty.isatty(2)) {
if (process.stdout.getWindowSize) {
width = process.stdout.getWindowSize(1)[0];
height = process.stdout.getWindowSize(1)[1];
} else if (tty.getWindowSize) {
width = tty.getWindowSize()[1];
height = tty.getWindowSize()[0];
} else if (process.stdout.columns && process.stdout.rows) {
height = process.stdout.columns;
width = process.stdout.rows;
}
} else {
Error('window-size could not get size with tty or process.stdout.');
}
return {height: height, width: width};
})();

View File

@ -0,0 +1,84 @@
{
"_args": [
[
"window-size@0.1.4",
"/Users/tatiana/selfdefined"
]
],
"_from": "window-size@0.1.4",
"_id": "window-size@0.1.4",
"_inBundle": false,
"_integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=",
"_location": "/nunjucks/window-size",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "window-size@0.1.4",
"name": "window-size",
"escapedName": "window-size",
"rawSpec": "0.1.4",
"saveSpec": null,
"fetchSpec": "0.1.4"
},
"_requiredBy": [
"/nunjucks/yargs"
],
"_resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz",
"_spec": "0.1.4",
"_where": "/Users/tatiana/selfdefined",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"bin": {
"window-size": "cli.js"
},
"bugs": {
"url": "https://github.com/jonschlinkert/window-size/issues"
},
"description": "Reliable way to to get the height and width of the terminal/console in a node.js environment.",
"devDependencies": {
"semistandard": "^7.0.2",
"tap": "^2.2.1"
},
"engines": {
"node": ">= 0.10.0"
},
"files": [
"index.js",
"cli.js"
],
"homepage": "https://github.com/jonschlinkert/window-size",
"keywords": [
"console",
"height",
"resize",
"size",
"terminal",
"tty",
"width",
"window"
],
"license": "MIT",
"main": "index.js",
"name": "window-size",
"repository": {
"type": "git",
"url": "git+https://github.com/jonschlinkert/window-size.git"
},
"scripts": {
"pretest": "semistandard",
"test": "tap --coverage test.js"
},
"verb": {
"related": {
"list": [
"yargs",
"lint-deps",
"base-cli"
]
}
},
"version": "0.1.4"
}

508
node_modules/nunjucks/node_modules/yargs/CHANGELOG.md generated vendored Normal file
View File

@ -0,0 +1,508 @@
## Change Log
### v3.32.0 (2016/1/14 10:13 +07:00)
- [#344](https://github.com/bcoe/yargs/pull/344) yargs now has a code of conduct and contributor guidelines (@bcoe)
- [#341](https://github.com/bcoe/yargs/issues/341) Fix edge-case with camel-case arguments (@davibe)
- [#331](https://github.com/bcoe/yargs/pull/331) Handle parsing a raw argument string (@kellyselden)
- [#325](https://github.com/bcoe/yargs/pull/325) Tweaks to make tests pass again on Windows (@isaacs)
- [#321](https://github.com/bcoe/yargs/pull/321) Custom config parsing function (@bcoe)
### v3.31.0 (2015/12/03 10:15 +07:00)
- [#239](https://github.com/bcoe/yargs/pull/239) Pass argv to commands (@bcoe)
- [#308](https://github.com/bcoe/yargs/pull/308) Yargs now handles environment variables (@nexdrew)
- [#302](https://github.com/bcoe/yargs/pull/302) Add Indonesian translation (@rilut)
- [#300](https://github.com/bcoe/yargs/pull/300) Add Turkish translation (@feyzo)
- [#298](https://github.com/bcoe/yargs/pull/298) Add Norwegian Bokmål translation (@sindresorhus)
- [#297](https://github.com/bcoe/yargs/pull/297) Fix for layout of cjk characters (@disjukr)
- [#296](https://github.com/bcoe/yargs/pull/296) Add Korean translation (@disjukr)
### v3.30.0 (2015/11/13 16:29 +07:00)
- [#293](https://github.com/bcoe/yargs/pull/293) Polish language support (@kamilogorek)
- [#291](https://github.com/bcoe/yargs/pull/291) fix edge-cases with `.alias()` (@bcoe)
- [#289](https://github.com/bcoe/yargs/pull/289) group options in custom groups (@bcoe)
### v3.29.0 (2015/10/16 21:51 +07:00)
- [#282](https://github.com/bcoe/yargs/pull/282) completions now accept promises (@LinusU)
- [#281](https://github.com/bcoe/yargs/pull/281) fix parsing issues with dot notation (@bcoe)
### v3.28.0 (2015/10/16 1:55 +07:00)
- [#277](https://github.com/bcoe/yargs/pull/277) adds support for ansi escape codes (@bcoe)
### v3.27.0 (2015/10/08 1:55 +00:00)
- [#271](https://github.com/bcoe/yargs/pull/273) skips validation for help or version flags with exitProcess(false) (@tepez)
- [#273](https://github.com/bcoe/yargs/pull/273) implements single output for errors with exitProcess(false) (@nexdrew)
- [#269](https://github.com/bcoe/yargs/pull/269) verifies single output for errors with exitProcess(false) (@tepez)
- [#268](https://github.com/bcoe/yargs/pull/268) adds Chinese translation (@qiu8310)
- [#266](https://github.com/bcoe/yargs/pull/266) adds case for -- after -- in parser test (@geophree)
### v3.26.0 (2015/09/25 2:14 +00:00)
- [#263](https://github.com/bcoe/yargs/pull/263) document count() and option() object keys (@nexdrew)
- [#259](https://github.com/bcoe/yargs/pull/259) remove util in readme (@38elements)
- [#258](https://github.com/bcoe/yargs/pull/258) node v4 builds, update deps (@nexdrew)
- [#257](https://github.com/bcoe/yargs/pull/257) fix spelling errors (@dkoleary88)
### v3.25.0 (2015/09/13 7:38 -07:00)
- [#254](https://github.com/bcoe/yargs/pull/254) adds Japanese translation (@oti)
- [#253](https://github.com/bcoe/yargs/pull/253) fixes for tests on Windows (@bcoe)
### v3.24.0 (2015/09/04 12:02 +00:00)
- [#248](https://github.com/bcoe/yargs/pull/248) reinstate os-locale, no spawning (@nexdrew)
- [#249](https://github.com/bcoe/yargs/pull/249) use travis container-based infrastructure (@nexdrew)
- [#247](https://github.com/bcoe/yargs/pull/247) upgrade standard (@nexdrew)
### v3.23.0 (2015/08/30 23:00 +00:00)
- [#246](https://github.com/bcoe/yargs/pull/246) detect locale based only on environment variables (@bcoe)
- [#244](https://github.com/bcoe/yargs/pull/244) adds Windows CI testing (@bcoe)
- [#245](https://github.com/bcoe/yargs/pull/245) adds OSX CI testing (@bcoe, @nexdrew)
### v3.22.0 (2015/08/28 22:26 +00:00)
- [#242](https://github.com/bcoe/yargs/pull/242) adds detectLocale config option (@bcoe)
### v3.21.1 (2015/08/28 20:58 +00:00)
- [#240](https://github.com/bcoe/yargs/pull/240) hot-fix for Atom on Windows (@bcoe)
### v3.21.0 (2015/08/21 21:20 +00:00)
- [#238](https://github.com/bcoe/yargs/pull/238) upgrade camelcase, window-size, chai, mocha (@nexdrew)
- [#237](https://github.com/bcoe/yargs/pull/237) adds defaultDescription to option() (@nexdrew)
### v3.20.0 (2015/08/20 01:29 +00:00)
- [#231](https://github.com/bcoe/yargs/pull/231) Merge pull request #231 from bcoe/detect-locale (@sindresorhus)
- [#235](https://github.com/bcoe/yargs/pull/235) adds german translation to yargs (@maxrimue)
### v3.19.0 (2015/08/14 05:12 +00:00)
- [#224](https://github.com/bcoe/yargs/pull/224) added Portuguese translation (@codemonkey3045)
### v3.18.1 (2015/08/12 05:53 +00:00)
- [#228](https://github.com/bcoe/yargs/pull/228) notes about embedding yargs in Electron (@etiktin)
- [#223](https://github.com/bcoe/yargs/pull/223) make booleans work in config files (@sgentle)
### v3.18.0 (2015/08/06 20:05 +00:00)
- [#222](https://github.com/bcoe/yargs/pull/222) updates fr locale (@nexdrew)
- [#221](https://github.com/bcoe/yargs/pull/221) adds missing locale strings (@nexdrew)
- [#220](https://github.com/bcoe/yargs/pull/220) adds es locale (@zkat)
### v3.17.1 (2015/08/02 19:35 +00:00)
- [#218](https://github.com/bcoe/yargs/pull/218) upgrades nyc (@bcoe)
### v3.17.0 (2015/08/02 18:39 +00:00)
- [#217](https://github.com/bcoe/yargs/pull/217) sort methods in README.md (@nexdrew)
- [#215](https://github.com/bcoe/yargs/pull/215) adds fr locale (@LoicMahieu)
### v3.16.0 (2015/07/30 04:35 +00:00)
- [#210](https://github.com/bcoe/yargs/pull/210) adds i18n support to yargs (@bcoe)
- [#209](https://github.com/bcoe/yargs/pull/209) adds choices type to yargs (@nexdrew)
- [#207](https://github.com/bcoe/yargs/pull/207) pretty new shields from shields.io (@SimenB)
- [#208](https://github.com/bcoe/yargs/pull/208) improvements to README.md (@nexdrew)
- [#205](https://github.com/bcoe/yargs/pull/205) faster build times on Travis (@ChristianMurphy)
### v3.15.0 (2015/07/06 06:01 +00:00)
- [#197](https://github.com/bcoe/yargs/pull/197) tweaks to how errors bubble up from parser.js (@bcoe)
- [#193](https://github.com/bcoe/yargs/pull/193) upgraded nyc, reporting now happens by default (@bcoe)
### v3.14.0 (2015/06/28 02:12 +00:00)
- [#192](https://github.com/bcoe/yargs/pull/192) standard style nits (@bcoe)
- [#190](https://github.com/bcoe/yargs/pull/190) allow for hidden commands, e.g.,
.completion('completion', false) (@tschaub)
### v3.13.0 (2015/06/24 04:12 +00:00)
- [#187](https://github.com/bcoe/yargs/pull/187) completion now behaves differently
if it is being run in the context of a command (@tschaub)
- [#186](https://github.com/bcoe/yargs/pull/186) if no matches are found for a completion
default to filename completion (@tschaub)
### v3.12.0 (2015/06/19 03:23 +00:00)
- [#183](https://github.com/bcoe/yargs/pull/183) don't complete commands if they've already been completed (@tschaub)
- [#181](https://github.com/bcoe/yargs/pull/181) various fixes for completion. (@bcoe, @tschaub)
- [#182](https://github.com/bcoe/yargs/pull/182) you can now set a maximum # of of required arguments (@bcoe)
### v3.11.0 (2015/06/15 05:15 +00:00)
- [#173](https://github.com/bcoe/yargs/pull/173) update standard, window-size, chai (@bcoe)
- [#171](https://github.com/bcoe/yargs/pull/171) a description can now be set
when providing a config option. (@5c077yP)
### v3.10.0 (2015/05/29 04:25 +00:00)
- [#165](https://github.com/bcoe/yargs/pull/165) expose yargs.terminalWidth() thanks @ensonic (@bcoe)
- [#164](https://github.com/bcoe/yargs/pull/164) better array handling thanks @getify (@bcoe)
### v3.9.1 (2015/05/20 05:14 +00:00)
- [b6662b6](https://github.com/bcoe/yargs/commit/b6662b6774cfeab4876f41ec5e2f67b7698f4e2f) clarify .config() docs (@linclark)
- [0291360](https://github.com/bcoe/yargs/commit/02913606285ce31ce81d7f12c48d8a3029776ec7) fixed tests, switched to nyc for coverage, fixed security issue, added Lin as collaborator (@bcoe)
### v3.9.0 (2015/05/10 18:32 +00:00)
- [#157](https://github.com/bcoe/yargs/pull/157) Merge pull request #157 from bcoe/command-yargs. allows handling of command specific arguments. Thanks for the suggestion @ohjames (@bcoe)
- [#158](https://github.com/bcoe/yargs/pull/158) Merge pull request #158 from kemitchell/spdx-license. Update license format (@kemitchell)
### v3.8.0 (2015/04/24 23:10 +00:00)
- [#154](https://github.com/bcoe/yargs/pull/154) showHelp's method signature was misleading fixes #153 (@bcoe)
- [#151](https://github.com/bcoe/yargs/pull/151) refactor yargs' table layout logic to use new helper library (@bcoe)
- [#150](https://github.com/bcoe/yargs/pull/150) Fix README example in argument requirements (@annonymouse)
### v3.7.2 (2015/04/13 11:52 -07:00)
* [679fbbf](https://github.com/bcoe/yargs/commit/679fbbf55904030ccee8a2635e8e5f46551ab2f0) updated yargs to use the [standard](https://github.com/feross/standard) style guide (agokjr)
* [22382ee](https://github.com/bcoe/yargs/commit/22382ee9f5b495bc2586c1758cd1091cec3647f9 various bug fixes for $0 (@nylen)
### v3.7.1 (2015/04/10 11:06 -07:00)
* [89e1992](https://github.com/bcoe/yargs/commit/89e1992a004ba73609b5f9ee6890c4060857aba4) detect iojs bin along with node bin. (@bcoe)
* [755509e](https://github.com/bcoe/yargs/commit/755509ea90041e5f7833bba3b8c5deffe56f0aab) improvements to example documentation in README.md (@rstacruz)
* [0d2dfc8](https://github.com/bcoe/yargs/commit/0d2dfc822a43418242908ad97ddd5291a1b35dc6) showHelp() no longer requires that .argv has been called (@bcoe)
### v3.7.0 (2015/04/04 02:29 -07:00)
* [56cbe2d](https://github.com/bcoe/yargs/commit/56cbe2ddd33dc176dcbf97ba40559864a9f114e4) make .requiresArg() work with type hints. (@bcoe).
* [2f5d562](https://github.com/bcoe/yargs/commit/2f5d5624f736741deeedf6a664d57bc4d857bdd0) serialize arrays and objects in usage strings. (@bcoe).
* [5126304](https://github.com/bcoe/yargs/commit/5126304dd18351fc28f10530616fdd9361e0af98) be more lenient about alias/primary key ordering in chaining API. (@bcoe)
### v3.6.0 (2015/03/21 01:00 +00:00)
- [4e24e22](https://github.com/bcoe/yargs/commit/4e24e22e6a195e55ab943ede704a0231ac33b99c) support for .js configuration files. (@pirxpilot)
### v3.5.4 (2015/03/12 05:56 +00:00)
- [c16cc08](https://github.com/bcoe/yargs/commit/c16cc085501155cf7fd853ccdf8584b05ab92b78) message for non-option arguments is now optional, thanks to (@raine)
### v3.5.3 (2015/03/09 06:14 +00:00)
- [870b428](https://github.com/bcoe/yargs/commit/870b428cf515d560926ca392555b7ad57dba9e3d) completion script was missing in package.json (@bcoe)
### v3.5.2 (2015/03/09 06:11 +00:00)
- [58a4b24](https://github.com/bcoe/yargs/commit/58a4b2473ebbb326713d522be53e32d3aabb08d2) parse was being called multiple times, resulting in strange behavior (@bcoe)
### v3.5.1 (2015/03/09 04:55 +00:00)
- [4e588e0](https://github.com/bcoe/yargs/commit/4e588e055afbeb9336533095f051496e3977f515) accidentally left testing logic in (@bcoe)
### v3.5.0 (2015/03/09 04:49 +00:00)
- [718bacd](https://github.com/bcoe/yargs/commit/718bacd81b9b44f786af76b2afe491fe06274f19) added support for bash completions see #4 (@bcoe)
- [a192882](https://github.com/bcoe/yargs/commit/a19288270fc431396c42af01125eeb4443664528) downgrade to mocha 2.1.0 until https://github.com/mochajs/mocha/issues/1585 can be sorted out (@bcoe)
### v3.4.7 (2015/03/09 04:09 +00:00)
- [9845e5c](https://github.com/bcoe/yargs/commit/9845e5c1a9c684ba0be3f0bfb40e7b62ab49d9c8) the Argv singleton was not being updated when manually parsing arguments, fixes #114 (@bcoe)
### v3.4.6 (2015/03/09 04:01 +00:00)
- [45b4c80](https://github.com/bcoe/yargs/commit/45b4c80b890d02770b0a94f326695a8a566e8fe9) set placeholders for all keys fixes #115 (@bcoe)
### v3.4.5 (2015/03/01 20:31 +00:00)
- [a758e0b](https://github.com/bcoe/yargs/commit/a758e0b2556184f067cf3d9c4ef886d39817ebd2) fix for count consuming too many arguments (@bcoe)
### v3.4.4 (2015/02/28 04:52 +00:00)
- [0476af7](https://github.com/bcoe/yargs/commit/0476af757966acf980d998b45108221d4888cfcb) added nargs feature, allowing you to specify the number of arguments after an option (@bcoe)
- [092477d](https://github.com/bcoe/yargs/commit/092477d7ab3efbf0ba11cede57f7d8cfc70b024f) updated README with full example of v3.0 API (@bcoe)
### v3.3.3 (2015/02/28 04:23 +00:00)
- [0c4b769](https://github.com/bcoe/yargs/commit/0c4b769516cd8d93a7c4e5e675628ae0049aa9a8) remove string dependency, which conflicted with other libraries see #106 (@bcoe)
### v3.3.2 (2015/02/28 04:11 +00:00)
- [2a98906](https://github.com/bcoe/yargs/commit/2a9890675821c0e7a12f146ce008b0562cb8ec9a) add $0 to epilog (@schnittstabil)
### v3.3.1 (2015/02/24 03:28 +00:00)
- [ad485ce](https://github.com/bcoe/yargs/commit/ad485ce748ebdfce25b88ef9d6e83d97a2f68987) fix for applying defaults to camel-case args (@bcoe)
### v3.3.0 (2015/02/24 00:49 +00:00)
- [8bfe36d](https://github.com/bcoe/yargs/commit/8bfe36d7fb0f93a799ea3f4c756a7467c320f8c0) fix and document restart() command, as a tool for building nested CLIs (@bcoe)
### v3.2.1 (2015/02/22 05:45 +00:00)
- [49a6d18](https://github.com/bcoe/yargs/commit/49a6d1822a4ef9b1ea6f90cc366be60912628885) you can now provide a function that generates a default value (@bcoe)
### v3.2.0 (2015/02/22 05:24 +00:00)
- [7a55886](https://github.com/bcoe/yargs/commit/7a55886c9343cf71a20744ca5cdd56d2ea7412d5) improvements to yargs two-column text layout (@bcoe)
- [b6ab513](https://github.com/bcoe/yargs/commit/b6ab5136a4c3fa6aa496f6b6360382e403183989) Tweak NPM version badge (@nylen)
### v3.1.0 (2015/02/19 19:37 +00:00)
- [9bd2379](https://github.com/bcoe/yargs/commit/9bd237921cf1b61fd9f32c0e6d23f572fc225861) version now accepts a function, making it easy to load version #s from a package.json (@bcoe)
### v3.0.4 (2015/02/14 01:40 +00:00)
- [0b7c19b](https://github.com/bcoe/yargs/commit/0b7c19beaecb747267ca4cc10e5cb2a8550bc4b7) various fixes for dot-notation handling (@bcoe)
### v3.0.3 (2015/02/14 00:59 +00:00)
- [c3f35e9](https://github.com/bcoe/yargs/commit/c3f35e99bd5a0d278073fcadd95e2d778616cc17) make sure dot-notation is applied to aliases (@bcoe)
### 3.0.2 (2015/02/13 16:50 +00:00)
- [74c8967](https://github.com/bcoe/yargs/commit/74c8967c340c204a0a7edf8a702b6f46c2705435) document epilog shorthand of epilogue. (@bcoe)
- [670110f](https://github.com/bcoe/yargs/commit/670110fc01bedc4831b6fec6afac54517d5a71bc) any non-truthy value now causes check to fail see #76 (@bcoe)
- [0d8f791](https://github.com/bcoe/yargs/commit/0d8f791a33c11ced4cd431ea8d3d3a337d456b56) finished implementing my wish-list of fetures for yargs 3.0. see #88 (@bcoe)
- [5768447](https://github.com/bcoe/yargs/commit/5768447447c4c8e8304f178846206ce86540f063) fix coverage. (@bcoe)
- [82e793f](https://github.com/bcoe/yargs/commit/82e793f3f61c41259eaacb67f0796aea2cf2aaa0) detect console width and perform word-wrapping. (@bcoe)
- [67476b3](https://github.com/bcoe/yargs/commit/67476b37eea07fee55f23f35b9e0c7d76682b86d) refactor two-column table layout so that we can use it for examples and usage (@bcoe)
- [4724cdf](https://github.com/bcoe/yargs/commit/4724cdfcc8e37ae1ca3dcce9d762f476e9ef4bb4) major refactor of index.js, in prep for 3.x release. (@bcoe)
### v2.3.0 (2015/02/08 20:41 +00:00)
- [d824620](https://github.com/bcoe/yargs/commit/d824620493df4e63664af1fe320764dd1a9244e6) allow for undefined boolean defaults (@ashi009)
### v2.2.0 (2015/02/08 20:07 +00:00)
- [d6edd98](https://github.com/bcoe/yargs/commit/d6edd9848826e7389ed1393858c45d03961365fd) in-prep for further refactoring, and a 3.x release I've shuffled some things around and gotten test-coverage to 100%. (@bcoe)
### v2.1.2 (2015/02/08 06:05 +00:00)
- [d640745](https://github.com/bcoe/yargs/commit/d640745a7b9f8d476e0223879d056d18d9c265c4) switch to path.relative (@bcoe)
- [3bfd41f](https://github.com/bcoe/yargs/commit/3bfd41ff262a041f29d828b88936a79c63cad594) remove mocha.opts. (@bcoe)
- [47a2f35](https://github.com/bcoe/yargs/commit/47a2f357091db70903a402d6765501c1d63f15fe) document using .string('_') for string ids. see #56 (@bcoe)
- [#57](https://github.com/bcoe/yargs/pull/57) Merge pull request #57 from eush77/option-readme (@eush77)
### v2.1.1 (2015/02/06 08:08 +00:00)
- [01c6c61](https://github.com/bcoe/yargs/commit/01c6c61d67b4ebf88f41f0b32a345ec67f0ac17d) fix for #71, 'newAliases' of undefined (@bcoe)
### v2.1.0 (2015/02/06 07:59 +00:00)
- [6a1a3fa](https://github.com/bcoe/yargs/commit/6a1a3fa731958e26ccd56885f183dd8985cc828f) try to guess argument types, and apply sensible defaults see #73 (@bcoe)
### v2.0.1 (2015/02/06 07:54 +00:00)
- [96a06b2](https://github.com/bcoe/yargs/commit/96a06b2650ff1d085a52b7328d8bba614c20cc12) Fix for strange behavior with --sort option, see #51 (@bcoe)
### v2.0.0 (2015/02/06 07:45 +00:00)
- [0250517](https://github.com/bcoe/yargs/commit/0250517c9643e53f431b824e8ccfa54937414011) - [108fb84](https://github.com/bcoe/yargs/commit/108fb8409a3a63dcaf99d917fe4dfcfaa1de236d) fixed bug with boolean parsing, when bools separated by = see #66 (@bcoe)
- [a465a59](https://github.com/bcoe/yargs/commit/a465a5915f912715738de890982e4f8395958b10) Add `files` field to the package.json (@shinnn)
- [31043de](https://github.com/bcoe/yargs/commit/31043de7a38a17c4c97711f1099f5fb164334db3) fix for yargs.argv having the same keys added multiple times see #63 (@bcoe)
- [2d68c5b](https://github.com/bcoe/yargs/commit/2d68c5b91c976431001c4863ce47c9297850f1ad) Disable process.exit calls using .exitProcess(false) (@cianclarke)
- [45da9ec](https://github.com/bcoe/yargs/commit/45da9ec4c55a7bd394721bc6a1db0dabad7bc52a) Mention .option in README (@eush77)
### v1.3.2 (2014/10/06 21:56 +00:00)
- [b8d3472](https://github.com/bcoe/yargs/commit/b8d34725482e5821a3cc809c0df71378f282f526) 1.3.2 (@chevex)
### list (2014/08/30 18:41 +00:00)
- [fbc777f](https://github.com/bcoe/yargs/commit/fbc777f416eeefd37c84e44d27d7dfc7c1925721) Now that yargs is the successor to optimist, I'm changing the README language to be more universal. Pirate speak isn't very accessible to non-native speakers. (@chevex)
- [a54d068](https://github.com/bcoe/yargs/commit/a54d0682ae2efc2394d407ab171cc8a8bbd135ea) version output will not print extra newline (@boneskull)
- [1cef5d6](https://github.com/bcoe/yargs/commit/1cef5d62a9d6d61a3948a49574892e01932cc6ae) Added contributors section to package.json (@chrisn)
- [cc295c0](https://github.com/bcoe/yargs/commit/cc295c0a80a2de267e0155b60d315fc4b6f7c709) Added 'require' and 'required' as synonyms for 'demand' (@chrisn)
- [d0bf951](https://github.com/bcoe/yargs/commit/d0bf951d949066b6280101ed606593d079ee15c8) Updating minimist. (@chevex)
- [c15f8e7](https://github.com/bcoe/yargs/commit/c15f8e7f245b261e542cf205ce4f4313630cbdb4) Fix #31 (bad interaction between camelCase options and strict mode) (@nylen)
- [d991b9b](https://github.com/bcoe/yargs/commit/d991b9be687a68812dee1e3b185ba64b7778b82d) Added .help() and .version() methods (@chrisn)
- [e8c8aa4](https://github.com/bcoe/yargs/commit/e8c8aa46268379357cb11e9fc34b8c403037724b) Added .showHelpOnFail() method (@chrisn)
- [e855af4](https://github.com/bcoe/yargs/commit/e855af4a933ea966b5bbdd3c4c6397a4bac1a053) Allow boolean flag with .demand() (@chrisn)
- [14dbec2](https://github.com/bcoe/yargs/commit/14dbec24fb7380683198e2b20c4deb8423e64bea) Fixes issue #22. Arguments are no longer printed to the console when using .config. (@chevex)
- [bef74fc](https://github.com/bcoe/yargs/commit/bef74fcddc1544598a804f80d0a3728459f196bf) Informing users that Yargs is the official optimist successor. (@chevex)
- [#24](https://github.com/bcoe/yargs/pull/24) Merge pull request #24 from chrisn/strict (@chrisn)
- [889a2b2](https://github.com/bcoe/yargs/commit/889a2b28eb9768801b05163360a470d0fd6c8b79) Added requiresArg option, for options that require values (@chrisn)
- [eb16369](https://github.com/bcoe/yargs/commit/eb163692262be1fe80b992fd8803d5923c5a9b18) Added .strict() method, to report error if unknown arguments are given (@chrisn)
- [0471c3f](https://github.com/bcoe/yargs/commit/0471c3fd999e1ad4e6cded88b8aa02013b66d14f) Changed optimist to yargs in usage-options.js example (@chrisn)
- [5c88f74](https://github.com/bcoe/yargs/commit/5c88f74e3cf031b17c54b4b6606c83e485ff520e) Change optimist to yargs in examples (@chrisn)
- [66f12c8](https://github.com/bcoe/yargs/commit/66f12c82ba3c943e4de8ca862980e835da8ecb3a) Fix a couple of bad interactions between aliases and defaults (@nylen)
- [8fa1d80](https://github.com/bcoe/yargs/commit/8fa1d80f14b03eb1f2898863a61f1d1615bceb50) Document second argument of usage(message, opts) (@Gobie)
- [56e6528](https://github.com/bcoe/yargs/commit/56e6528cf674ff70d63083fb044ff240f608448e) For "--some-option", also set argv.someOption (@nylen)
- [ed5f6d3](https://github.com/bcoe/yargs/commit/ed5f6d33f57ad1086b11c91b51100f7c6c7fa8ee) Finished porting unit tests to Mocha. (@chevex)
### v1.0.15 (2014/02/05 23:18 +00:00)
- [e2b1fc0](https://github.com/bcoe/yargs/commit/e2b1fc0c4a59cf532ae9b01b275e1ef57eeb64d2) 1.0.15 update to badges (@chevex)
### v1.0.14 (2014/02/05 23:17 +00:00)
- [f33bbb0](https://github.com/bcoe/yargs/commit/f33bbb0f00fe18960f849cc8e15a7428a4cd59b8) Revert "Fixed issue which caused .demand function not to work correctly." (@chevex)
### v1.0.13 (2014/02/05 22:13 +00:00)
- [6509e5e](https://github.com/bcoe/yargs/commit/6509e5e7dee6ef1a1f60eea104be0faa1a045075) Fixed issue which caused .demand function not to work correctly. (@chevex)
### v1.0.12 (2013/12/13 00:09 +00:00)
- [05eb267](https://github.com/bcoe/yargs/commit/05eb26741c9ce446b33ff006e5d33221f53eaceb) 1.0.12 (@chevex)
### v1.0.11 (2013/12/13 00:07 +00:00)
- [c1bde46](https://github.com/bcoe/yargs/commit/c1bde46e37318a68b87d17a50c130c861d6ce4a9) 1.0.11 (@chevex)
### v1.0.10 (2013/12/12 23:57 +00:00)
- [dfebf81](https://github.com/bcoe/yargs/commit/dfebf8164c25c650701528ee581ca483a99dc21c) Fixed formatting in README (@chevex)
### v1.0.9 (2013/12/12 23:47 +00:00)
- [0b4e34a](https://github.com/bcoe/yargs/commit/0b4e34af5e6d84a9dbb3bb6d02cd87588031c182) Update README.md (@chevex)
### v1.0.8 (2013/12/06 16:36 +00:00)
- [#1](https://github.com/bcoe/yargs/pull/1) fix error caused by check() see #1 (@martinheidegger)
### v1.0.7 (2013/11/24 18:01 +00:00)
- [a247d88](https://github.com/bcoe/yargs/commit/a247d88d6e46644cbb7303c18b1bb678fc132d72) Modified Pirate Joe image. (@chevex)
### v1.0.6 (2013/11/23 19:21 +00:00)
- [d7f69e1](https://github.com/bcoe/yargs/commit/d7f69e1d34bc929736a8bdccdc724583e21b7eab) Updated Pirate Joe image. (@chevex)
### v1.0.5 (2013/11/23 19:09 +00:00)
- [ece809c](https://github.com/bcoe/yargs/commit/ece809cf317cc659175e1d66d87f3ca68c2760be) Updated readme notice again. (@chevex)
### v1.0.4 (2013/11/23 19:05 +00:00)
- [9e81e81](https://github.com/bcoe/yargs/commit/9e81e81654028f83ba86ffc3ac772a0476084e5e) Updated README with a notice about yargs being a fork of optimist and what that implies. (@chevex)
### v1.0.3 (2013/11/23 17:43 +00:00)
- [65e7a78](https://github.com/bcoe/yargs/commit/65e7a782c86764944d63d084416aba9ee6019c5f) Changed some small wording in README.md. (@chevex)
- [459e20e](https://github.com/bcoe/yargs/commit/459e20e539b366b85128dd281ccd42221e96c7da) Fix a bug in the options function, when string and boolean options weren't applied to aliases. (@shockone)
### v1.0.2 (2013/11/23 09:46 +00:00)
- [3d80ebe](https://github.com/bcoe/yargs/commit/3d80ebed866d3799224b6f7d596247186a3898a9) 1.0.2 (@chevex)
### v1.0.1 (2013/11/23 09:39 +00:00)
- [f80ff36](https://github.com/bcoe/yargs/commit/f80ff3642d580d4b68bf9f5a94277481bd027142) Updated image. (@chevex)
### v1.0.0 (2013/11/23 09:33 +00:00)
- [54e31d5](https://github.com/bcoe/yargs/commit/54e31d505f820b80af13644e460894b320bf25a3) Rebranded from optimist to yargs in the spirit of the fork :D (@chevex)
- [4ebb6c5](https://github.com/bcoe/yargs/commit/4ebb6c59f44787db7c24c5b8fe2680f01a23f498) Added documentation for demandCount(). (@chevex)
- [4561ce6](https://github.com/bcoe/yargs/commit/4561ce66dcffa95f49e8b4449b25b94cd68acb25) Simplified the error messages returned by .check(). (@chevex)
- [661c678](https://github.com/bcoe/yargs/commit/661c67886f479b16254a830b7e1db3be29e6b7a6) Fixed an issue with demand not accepting a zero value. (@chevex)
- [731dd3c](https://github.com/bcoe/yargs/commit/731dd3c37624790490bd6df4d5f1da8f4348279e) Add .fail(fn) so death isn't the only option. Should fix issue #39. (@chevex)
- [fa15417](https://github.com/bcoe/yargs/commit/fa15417ff9e70dace0d726627a5818654824c1d8) Added a few missing 'return self' (@chevex)
- [e655e4d](https://github.com/bcoe/yargs/commit/e655e4d99d1ae1d3695ef755d51c2de08d669761) Fix showing help in certain JS environments. (@chevex)
- [a746a31](https://github.com/bcoe/yargs/commit/a746a31cd47c87327028e6ea33762d6187ec5c87) Better string representation of default values. (@chevex)
- [6134619](https://github.com/bcoe/yargs/commit/6134619a7e90b911d5443230b644c5d447c1a68c) Implies: conditional demands (@chevex)
- [046b93b](https://github.com/bcoe/yargs/commit/046b93b5d40a27367af4cb29726e4d781d934639) Added support for JSON config files. (@chevex)
- [a677ec0](https://github.com/bcoe/yargs/commit/a677ec0a0ecccd99c75e571d03323f950688da03) Add .example(cmd, desc) feature. (@chevex)
- [1bd4375](https://github.com/bcoe/yargs/commit/1bd4375e11327ba1687d4bb6e5e9f3c30c1be2af) Added 'defaults' as alias to 'default' so as to avoid usage of a reserved keyword. (@chevex)
- [6b753c1](https://github.com/bcoe/yargs/commit/6b753c16ca09e723060e70b773b430323b29c45c) add .normalize(args..) support for normalizing paths (@chevex)
- [33d7d59](https://github.com/bcoe/yargs/commit/33d7d59341d364f03d3a25f0a55cb99004dbbe4b) Customize error messages with demand(key, msg) (@chevex)
- [647d37f](https://github.com/bcoe/yargs/commit/647d37f164c20f4bafbf67dd9db6cd6e2cd3b49f) Merge branch 'rewrite-duplicate-test' of github.com:isbadawi/node-optimist (@chevex)
- [9059d1a](https://github.com/bcoe/yargs/commit/9059d1ad5e8aea686c2a01c89a23efdf929fff2e) Pass aliases object to check functions for greater versatility. (@chevex)
- [623dc26](https://github.com/bcoe/yargs/commit/623dc26c7331abff2465ef8532e3418996d42fe6) Added ability to count boolean options and rolled minimist library back into project. (@chevex)
- [49f0dce](https://github.com/bcoe/yargs/commit/49f0dcef35de4db544c3966350d36eb5838703f6) Fixed small typo. (@chevex)
- [79ec980](https://github.com/bcoe/yargs/commit/79ec9806d9ca6eb0014cfa4b6d1849f4f004baf2) Removed dependency on wordwrap module. (@chevex)
- [ea14630](https://github.com/bcoe/yargs/commit/ea14630feddd69d1de99dd8c0e08948f4c91f00a) Merge branch 'master' of github.com:chbrown/node-optimist (@chevex)
- [2b75da2](https://github.com/bcoe/yargs/commit/2b75da2624061e0f4f3107d20303c06ec9054906) Merge branch 'master' of github.com:seanzhou1023/node-optimist (@chevex)
- [d9bda11](https://github.com/bcoe/yargs/commit/d9bda1116e26f3b40e833ca9ca19263afea53565) Merge branch 'patch-1' of github.com:thefourtheye/node-optimist (@chevex)
- [d6cc606](https://github.com/bcoe/yargs/commit/d6cc6064a4f1bea38a16a4430b8a1334832fbeff) Renamed README. (@chevex)
- [9498d3f](https://github.com/bcoe/yargs/commit/9498d3f59acfb5e102826503e681623c3a64b178) Renamed readme and added .gitignore. (@chevex)
- [bbd1fe3](https://github.com/bcoe/yargs/commit/bbd1fe37fefa366dde0fb3dc44d91fe8b28f57f5) Included examples for ```help``` and ```showHelp``` functions and fixed few formatting issues (@thefourtheye)
- [37fea04](https://github.com/bcoe/yargs/commit/37fea0470a5796a0294c1dcfff68d8041650e622) .alias({}) behaves differently based on mapping direction when generating descriptions (@chbrown)
- [855b20d](https://github.com/bcoe/yargs/commit/855b20d0be567ca121d06b30bea64001b74f3d6d) Documented function signatures are useful for dynamically typed languages. (@chbrown)
### 0.6.0 (2013/06/25 08:48 +00:00)
- [d37bfe0](https://github.com/bcoe/yargs/commit/d37bfe05ae6d295a0ab481efe4881222412791f4) all tests passing using minimist (@substack)
- [76f1352](https://github.com/bcoe/yargs/commit/76f135270399d01f2bbc621e524a5966e5c422fd) all parse tests now passing (@substack)
- [a7b6754](https://github.com/bcoe/yargs/commit/a7b6754276c38d1565479a5685c3781aeb947816) using minimist, some tests passing (@substack)
- [6655688](https://github.com/bcoe/yargs/commit/66556882aa731cbbbe16cc4d42c85740a2e98099) Give credit where its due (@DeadAlready)
- [602a2a9](https://github.com/bcoe/yargs/commit/602a2a92a459f93704794ad51b115bbb08b535ce) v0.5.3 - Remove wordwrap as dependency (@DeadAlready)
### 0.5.2 (2013/05/31 03:46 +00:00)
- [4497ca5](https://github.com/bcoe/yargs/commit/4497ca55e332760a37b866ec119ded347ca27a87) fixed the whitespace bug without breaking anything else (@substack)
- [5a3dd1a](https://github.com/bcoe/yargs/commit/5a3dd1a4e0211a38613c6e02f61328e1031953fa) failing test for whitespace arg (@substack)
### 0.5.1 (2013/05/30 07:17 +00:00)
- [a20228f](https://github.com/bcoe/yargs/commit/a20228f62a454755dd07f628a7c5759113918327) fix parse() to work with functions before it (@substack)
- [b13bd4c](https://github.com/bcoe/yargs/commit/b13bd4cac856a9821d42fa173bdb58f089365a7d) failing test for parse() with modifiers (@substack)
### 0.5.0 (2013/05/18 21:59 +00:00)
- [c474a64](https://github.com/bcoe/yargs/commit/c474a649231527915c222156e3b40806d365a87c) fixes for dash (@substack)
### 0.4.0 (2013/04/13 19:03 +00:00)
- [dafe3e1](https://github.com/bcoe/yargs/commit/dafe3e18d7c6e7c2d68e06559df0e5cbea3adb14) failing short test (@substack)
### 0.3.7 (2013/04/04 04:07 +00:00)
- [6c7a0ec](https://github.com/bcoe/yargs/commit/6c7a0ec94ce4199a505f0518b4d6635d4e47cc81) Fix for windows. On windows there is no _ in environment. (@hdf)
### 0.3.6 (2013/04/04 04:04 +00:00)
- [e72346a](https://github.com/bcoe/yargs/commit/e72346a727b7267af5aa008b418db89970873f05) Add support for newlines in -a="" arguments (@danielbeardsley)
- [71e1fb5](https://github.com/bcoe/yargs/commit/71e1fb55ea9987110a669ac6ec12338cfff3821c) drop 0.4, add 0.8 to travis (@substack)
### 0.3.5 (2012/10/10 11:09 +00:00)
- [ee692b3](https://github.com/bcoe/yargs/commit/ee692b37554c70a0bb16389a50a26b66745cbbea) Fix parsing booleans (@vojtajina)
- [5045122](https://github.com/bcoe/yargs/commit/5045122664c3f5b4805addf1be2148d5856f7ce8) set $0 properly in the tests (@substack)
### 0.3.4 (2012/04/30 06:54 +00:00)
- [f28c0e6](https://github.com/bcoe/yargs/commit/f28c0e62ca94f6e0bb2e6d82fc3d91a55e69b903) bump for string "true" params (@substack)
- [8f44aeb](https://github.com/bcoe/yargs/commit/8f44aeb74121ddd689580e2bf74ef86a605e9bf2) Fix failing test for aliased booleans. (@coderarity)
- [b9f7b61](https://github.com/bcoe/yargs/commit/b9f7b613b1e68e11e6c23fbda9e555a517dcc976) Add failing test for short aliased booleans. (@coderarity)
### 0.3.3 (2012/04/30 06:45 +00:00)
- [541bac8](https://github.com/bcoe/yargs/commit/541bac8dd787a5f1a5d28f6d8deb1627871705e7) Fixes #37.
### 0.3.2 (2012/04/12 20:28 +00:00)
- [3a0f014](https://github.com/bcoe/yargs/commit/3a0f014c1451280ac1c9caa1f639d31675586eec) travis badge (@substack)
- [4fb60bf](https://github.com/bcoe/yargs/commit/4fb60bf17845f4ce3293f8ca49c9a1a7c736cfce) Fix boolean aliases. (@coderarity)
- [f14dda5](https://github.com/bcoe/yargs/commit/f14dda546efc4fe06ace04d36919bfbb7634f79b) Adjusted package.json to use tap (@jfhbrook)
- [88e5d32](https://github.com/bcoe/yargs/commit/88e5d32295be6e544c8d355ff84e355af38a1c74) test/usage.js no longer hangs (@jfhbrook)
- [e1e740c](https://github.com/bcoe/yargs/commit/e1e740c27082f3ce84deca2093d9db2ef735d0e5) two tests for combined boolean/alias opts parsing (@jfhbrook)
### 0.3.1 (2011/12/31 08:44 +00:00)
- [d09b719](https://github.com/bcoe/yargs/commit/d09b71980ef711b6cf3918cd19beec8257e40e82) If "default" is set to false it was not passed on, fixed. (@wolframkriesing)
### 0.3.0 (2011/12/09 06:03 +00:00)
- [6e74aa7](https://github.com/bcoe/yargs/commit/6e74aa7b46a65773e20c0cb68d2d336d4a0d553d) bump and documented dot notation (@substack)
### 0.2.7 (2011/10/20 02:25 +00:00)
- [94adee2](https://github.com/bcoe/yargs/commit/94adee20e17b58d0836f80e8b9cdbe9813800916) argv._ can be told 'Hey! argv._! Don't be messing with my args.', and it WILL obey (@colinta)
- [c46fdd5](https://github.com/bcoe/yargs/commit/c46fdd56a05410ae4a1e724a4820c82e77ff5469) optimistic critter image (@substack)
- [5c95c73](https://github.com/bcoe/yargs/commit/5c95c73aedf4c7482bd423e10c545e86d7c8a125) alias options() to option() (@substack)
- [f7692ea](https://github.com/bcoe/yargs/commit/f7692ea8da342850af819367833abb685fde41d8) [fix] Fix for parsing boolean edge case (@indexzero)
- [d1f92d1](https://github.com/bcoe/yargs/commit/d1f92d1425bd7f356055e78621b30cdf9741a3c2)
- [b01bda8](https://github.com/bcoe/yargs/commit/b01bda8d86e455bbf74ce497864cb8ab5b9fb847) [fix test] Update to ensure optimist is aware of default booleans. Associated tests included (@indexzero)
- [aa753e7](https://github.com/bcoe/yargs/commit/aa753e7c54fb3a12f513769a0ff6d54aa0f63943) [dist test] Update devDependencies in package.json. Update test pathing to be more npm and require.paths future-proof (@indexzero)
- [7bfce2f](https://github.com/bcoe/yargs/commit/7bfce2f3b3c98e6539e7549d35fbabced7e9341e) s/sys/util/ (@substack)
- [d420a7a](https://github.com/bcoe/yargs/commit/d420a7a9c890d2cdb11acfaf3ea3f43bc3e39f41) update usage output (@substack)
- [cf86eed](https://github.com/bcoe/yargs/commit/cf86eede2e5fc7495b6ec15e6d137d9ac814f075) some sage readme protips about parsing rules (@substack)
- [5da9f7a](https://github.com/bcoe/yargs/commit/5da9f7a5c0e1758ec7c5801fb3e94d3f6e970513) documented all the methods finally (@substack)
- [8ca6879](https://github.com/bcoe/yargs/commit/8ca6879311224b25933642987300f6a29de5c21b) fenced syntax highlighting (@substack)
- [b72bacf](https://github.com/bcoe/yargs/commit/b72bacf1d02594778c1935405bc8137eb61761dc) right-alignment of wrapped extra params (@substack)
- [2b980bf](https://github.com/bcoe/yargs/commit/2b980bf2656b4ee8fc5134dc5f56a48855c35198) now with .wrap() (@substack)
- [d614f63](https://github.com/bcoe/yargs/commit/d614f639654057d1b7e35e3f5a306e88ec2ad1e4) don't show 'Options:' when there aren't any (@substack)
- [691eda3](https://github.com/bcoe/yargs/commit/691eda354df97b5a86168317abcbcaabdc08a0fb) failing test for multi-aliasing (@substack)
- [0826c9f](https://github.com/bcoe/yargs/commit/0826c9f462109feab2bc7a99346d22e72bf774b7) "Options:" > "options:" (@substack)
- [72f7490](https://github.com/bcoe/yargs/commit/72f749025d01b7f295738ed370a669d885fbada0) [minor] Update formatting for `.showHelp()` (@indexzero)
- [75aecce](https://github.com/bcoe/yargs/commit/75aeccea74329094072f95800e02c275e7d999aa) options works again, too lazy to write a proper test right now (@substack)
- [f742e54](https://github.com/bcoe/yargs/commit/f742e5439817c662dc3bd8734ddd6467e6018cfd) line_count_options example, which breaks (@substack)
- [4ca06b8](https://github.com/bcoe/yargs/commit/4ca06b8b4ea99b5d5714b315a2a8576bee6e5537) line count example (@substack)
- [eeb8423](https://github.com/bcoe/yargs/commit/eeb8423e0a5ecc9dc3eb1e6df9f3f8c1c88f920b) remove self.argv setting in boolean (@substack)
- [6903412](https://github.com/bcoe/yargs/commit/69034126804660af9cc20ea7f4457b50338ee3d7) removed camel case for now (@substack)
- [5a0d88b](https://github.com/bcoe/yargs/commit/5a0d88bf23e9fa79635dd034e2a1aa992acc83cd) remove dead longest checking code (@substack)
- [d782170](https://github.com/bcoe/yargs/commit/d782170babf7284b1aa34f5350df0dd49c373fa8) .help() too (@substack)
- [622ec17](https://github.com/bcoe/yargs/commit/622ec17379bb5374fdbb190404c82bc600975791) rm old help generator (@substack)
- [7c8baac](https://github.com/bcoe/yargs/commit/7c8baac4d66195e9f5158503ea9ebfb61153dab7) nub keys (@substack)
- [8197785](https://github.com/bcoe/yargs/commit/8197785ad4762465084485b041abd722f69bf344) generate help message based on the previous calls, todo: nub (@substack)
- [3ffbdc3](https://github.com/bcoe/yargs/commit/3ffbdc33c8f5e83d4ea2ac60575ce119570c7ede) stub out new showHelp, better checks (@substack)
- [d4e21f5](https://github.com/bcoe/yargs/commit/d4e21f56a4830f7de841900d3c79756fb9886184) let .options() take single options too (@substack)
- [3c4cf29](https://github.com/bcoe/yargs/commit/3c4cf2901a29bac119cca8e983028d8669230ec6) .options() is now heaps simpler (@substack)
- [89f0d04](https://github.com/bcoe/yargs/commit/89f0d043cbccd302f10ab30c2069e05d2bf817c9) defaults work again, all tests pass (@substack)
- [dd87333](https://github.com/bcoe/yargs/commit/dd8733365423006a6e4156372ebb55f98323af58) update test error messages, down to 2 failing tests (@substack)
- [53f7bc6](https://github.com/bcoe/yargs/commit/53f7bc626b9875f2abdfc5dd7a80bde7f14143a3) fix for bools doubling up, passes the parse test again, others fail (@substack)
- [2213e2d](https://github.com/bcoe/yargs/commit/2213e2ddc7263226fba717fb041dc3fde9bc2ee4) refactored for an argv getter, failing several tests (@substack)
- [d1e7379](https://github.com/bcoe/yargs/commit/d1e737970f15c6c006bebdd8917706827ff2f0f2) just rescan for now, alias test passes (@substack)
- [b2f8c99](https://github.com/bcoe/yargs/commit/b2f8c99cc477a8eb0fdf4cf178e1785b63185cfd) failing alias test (@substack)
- [d0c0174](https://github.com/bcoe/yargs/commit/d0c0174daa144bfb6dc7290fdc448c393c475e15) .alias() (@substack)
- [d85f431](https://github.com/bcoe/yargs/commit/d85f431ad7d07b058af3f2a57daa51495576c164) [api] Remove `.describe()` in favor of building upon the existing `.usage()` API (@indexzero)
- [edbd527](https://github.com/bcoe/yargs/commit/edbd5272a8e213e71acd802782135c7f9699913a) [doc api] Add `.describe()`, `.options()`, and `.showHelp()` methods along with example. (@indexzero)
- [be4902f](https://github.com/bcoe/yargs/commit/be4902ff0961ae8feb9093f2c0a4066463ded2cf) updates for coffee since it now does argv the node way (@substack)
- [e24cb23](https://github.com/bcoe/yargs/commit/e24cb23798ee64e53b60815e7fda78b87f42390c) more general coffeescript detection (@substack)
- [78ac753](https://github.com/bcoe/yargs/commit/78ac753e5d0ec32a96d39d893272afe989e42a4d) Don't trigger the CoffeeScript hack when running under node_g. (@papandreou)
- [bcfe973](https://github.com/bcoe/yargs/commit/bcfe9731d7f90d4632281b8a52e8d76eb0195ae6) .string() but failing test (@substack)
- [1987aca](https://github.com/bcoe/yargs/commit/1987aca28c7ba4e8796c07bbc547cb984804c826) test hex strings (@substack)
- [ef36db3](https://github.com/bcoe/yargs/commit/ef36db32259b0b0d62448dc907c760e5554fb7e7) more keywords (@substack)
- [cc53c56](https://github.com/bcoe/yargs/commit/cc53c56329960bed6ab077a79798e991711ba01d) Added camelCase function that converts --multi-word-option to camel case (so it becomes argv.multiWordOption). (@papandreou)
- [60b57da](https://github.com/bcoe/yargs/commit/60b57da36797716e5783a633c6d5c79099016d45) fixed boolean bug by rescanning (@substack)
- [dff6d07](https://github.com/bcoe/yargs/commit/dff6d078d97f8ac503c7d18dcc7b7a8c364c2883) boolean examples (@substack)
- [0e380b9](https://github.com/bcoe/yargs/commit/0e380b92c4ef4e3c8dac1da18b5c31d85b1d02c9) boolean() with passing test (@substack)
- [62644d4](https://github.com/bcoe/yargs/commit/62644d4bffbb8d1bbf0c2baf58a1d14a6359ef07) coffee compatibility with node regex for versions too (@substack)
- [430fafc](https://github.com/bcoe/yargs/commit/430fafcf1683d23774772826581acff84b456827) argv._ fixed by fixing the coffee detection (@substack)
- [343b8af](https://github.com/bcoe/yargs/commit/343b8afefd98af274ebe21b5a16b3a949ec5429f) whichNodeArgs test fails too (@substack)
- [63df2f3](https://github.com/bcoe/yargs/commit/63df2f371f31e63d7f1dec2cbf0022a5f08da9d2) replicated mnot's bug in whichNodeEmpty test (@substack)
- [35473a4](https://github.com/bcoe/yargs/commit/35473a4d93a45e5e7e512af8bb54ebb532997ae1) test for ./bin usage (@substack)
- [13df151](https://github.com/bcoe/yargs/commit/13df151e44228eed10e5441c7cd163e086c458a4) don't coerce booleans to numbers (@substack)
- [85f8007](https://github.com/bcoe/yargs/commit/85f8007e93b8be7124feea64b1f1916d8ba1894a) package bump for automatic number conversion (@substack)
- [8f17014](https://github.com/bcoe/yargs/commit/8f170141cded4ccc0c6d67a849c5bf996aa29643) updated readme and examples with new auto-numberification goodness (@substack)
- [73dc901](https://github.com/bcoe/yargs/commit/73dc9011ac968e39b55e19e916084a839391b506) auto number conversion works yay (@substack)
- [bcec56b](https://github.com/bcoe/yargs/commit/bcec56b3d031e018064cbb691539ccc4f28c14ad) failing test for not-implemented auto numification (@substack)
- [ebd2844](https://github.com/bcoe/yargs/commit/ebd2844d683feeac583df79af0e5124a7a7db04e) odd that eql doesn't check types careflly (@substack)
- [fd854b0](https://github.com/bcoe/yargs/commit/fd854b02e512ce854b76386d395672a7969c1bc4) package author + keywords (@substack)
- [656a1d5](https://github.com/bcoe/yargs/commit/656a1d5a1b7c0e49d72e80cb13f20671d56f76c6) updated readme with .default() stuff (@substack)
- [cd7f8c5](https://github.com/bcoe/yargs/commit/cd7f8c55f0b82b79b690d14c5f806851236998a1) passing tests for new .default() behavior (@substack)
- [932725e](https://github.com/bcoe/yargs/commit/932725e39ce65bc91a0385a5fab659a5fa976ac2) new default() thing for setting default key/values (@substack)
- [4e6c7ab](https://github.com/bcoe/yargs/commit/4e6c7aba6374ac9ebc6259ecf91f13af7bce40e3) test for coffee usage (@substack)
- [d54ffcc](https://github.com/bcoe/yargs/commit/d54ffccf2a5a905f51ed5108f7c647f35d64ae23) new --key value style with passing tests. NOTE: changes existing behavior (@substack)
- [ed2a2d5](https://github.com/bcoe/yargs/commit/ed2a2d5d828100ebeef6385c0fb88d146a5cfe9b) package bump for summatix's coffee script fix (@substack)
- [75a975e](https://github.com/bcoe/yargs/commit/75a975eed8430d28e2a79dc9e6d819ad545f4587) Added support for CoffeeScript (@summatix)
- [56b2b1d](https://github.com/bcoe/yargs/commit/56b2b1de8d11f8a2b91979d8ae2d6db02d8fe64d) test coverage for the falsy check() usage (@substack)
- [a4843a9](https://github.com/bcoe/yargs/commit/a4843a9f0e69ffb4afdf6a671d89eb6f218be35d) check bug fixed plus a handy string (@substack)
- [857bd2d](https://github.com/bcoe/yargs/commit/857bd2db933a5aaa9cfecba0ced2dc9b415f8111) tests for demandCount, back up to 100% coverage (@substack)
- [073b776](https://github.com/bcoe/yargs/commit/073b7768ebd781668ef05c13f9003aceca2f5c35) call demandCount from demand (@substack)
- [4bd4b7a](https://github.com/bcoe/yargs/commit/4bd4b7a085c8b6ce1d885a0f486cc9865cee2db1) add demandCount to check for the number of arguments in the _ list (@marshall)
- [b8689ac](https://github.com/bcoe/yargs/commit/b8689ac68dacf248119d242bba39a41cb0adfa07) Rebase checks. That will be its own module eventually. (@substack)
- [e688370](https://github.com/bcoe/yargs/commit/e688370b576f0aa733c3f46183df69e1b561668e) a $0 like in perl (@substack)
- [2e5e196](https://github.com/bcoe/yargs/commit/2e5e1960fc19afb21fb3293752316eaa8bcd3609) usage test hacking around process and console (@substack)
- [fcc3521](https://github.com/bcoe/yargs/commit/fcc352163fbec6a1dfe8caf47a0df39de24fe016) description pun (@substack)
- [87a1fe2](https://github.com/bcoe/yargs/commit/87a1fe29037ca2ca5fefda85141aaeb13e8ce761) mit/x11 license (@substack)
- [8d089d2](https://github.com/bcoe/yargs/commit/8d089d24cd687c0bde3640a96c09b78f884900dd) bool example is more consistent and also shows off short option grouping (@substack)
- [448d747](https://github.com/bcoe/yargs/commit/448d7473ac68e8e03d8befc9457b0d9e21725be0) start of the readme and examples (@substack)
- [da74dea](https://github.com/bcoe/yargs/commit/da74dea799a9b59dbf022cbb8001bfdb0d52eec9) more tests for long and short captures (@substack)
- [ab6387e](https://github.com/bcoe/yargs/commit/ab6387e6769ca4af82ca94c4c67c7319f0d9fcfa) silly bug in the tests with s/not/no/, all tests pass now (@substack)
- [102496a](https://github.com/bcoe/yargs/commit/102496a319e8e06f6550d828fc2f72992c7d9ecc) hack an instance for process.argv onto Argv so the export can be called to create an instance or used for argv, which is the most common case (@substack)
- [a01caeb](https://github.com/bcoe/yargs/commit/a01caeb532546d19f68f2b2b87f7036cfe1aaedd) divide example (@substack)
- [443da55](https://github.com/bcoe/yargs/commit/443da55736acbaf8ff8b04d1b9ce19ab016ddda2) start of the lib with a package.json (@substack)

21
node_modules/nunjucks/node_modules/yargs/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
Copyright 2010 James Halliday (mail@substack.net)
This project is free software released under the MIT/X11 license:
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.

1243
node_modules/nunjucks/node_modules/yargs/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
###-begin-{{app_name}}-completions-###
#
# yargs command completion script
#
# Installation: {{app_path}} completion >> ~/.bashrc
# or {{app_path}} completion >> ~/.bash_profile on OSX.
#
_yargs_completions()
{
local cur_word args type_list
cur_word="${COMP_WORDS[COMP_CWORD]}"
args=$(printf "%s " "${COMP_WORDS[@]}")
# ask yargs to generate completions.
type_list=`{{app_path}} --get-yargs-completions $args`
COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )
# if no match was found, fall back to filename completion
if [ ${#COMPREPLY[@]} -eq 0 ]; then
COMPREPLY=( $(compgen -f -- "${cur_word}" ) )
fi
return 0
}
complete -F _yargs_completions {{app_name}}
###-end-{{app_name}}-completions-###

665
node_modules/nunjucks/node_modules/yargs/index.js generated vendored Normal file
View File

@ -0,0 +1,665 @@
var assert = require('assert')
var Completion = require('./lib/completion')
var Parser = require('./lib/parser')
var path = require('path')
var tokenizeArgString = require('./lib/tokenize-arg-string')
var Usage = require('./lib/usage')
var Validation = require('./lib/validation')
var Y18n = require('y18n')
Argv(process.argv.slice(2))
var exports = module.exports = Argv
function Argv (processArgs, cwd) {
processArgs = processArgs || [] // handle calling yargs().
var self = {}
var completion = null
var usage = null
var validation = null
var y18n = Y18n({
directory: path.resolve(__dirname, './locales'),
updateFiles: false
})
if (!cwd) cwd = process.cwd()
self.$0 = process.argv
.slice(0, 2)
.map(function (x, i) {
// ignore the node bin, specify this in your
// bin file with #!/usr/bin/env node
if (i === 0 && /\b(node|iojs)$/.test(x)) return
var b = rebase(cwd, x)
return x.match(/^\//) && b.length < x.length ? b : x
})
.join(' ').trim()
if (process.env._ !== undefined && process.argv[1] === process.env._) {
self.$0 = process.env._.replace(
path.dirname(process.execPath) + '/', ''
)
}
var options
self.resetOptions = self.reset = function () {
// put yargs back into its initial
// state, this is useful for creating a
// nested CLI.
options = {
array: [],
boolean: [],
string: [],
narg: {},
key: {},
alias: {},
default: {},
defaultDescription: {},
choices: {},
requiresArg: [],
count: [],
normalize: [],
config: {},
envPrefix: undefined
}
usage = Usage(self, y18n) // handle usage output.
validation = Validation(self, usage, y18n) // handle arg validation.
completion = Completion(self, usage)
demanded = {}
groups = {}
exitProcess = true
strict = false
helpOpt = null
versionOpt = null
commandHandlers = {}
self.parsed = false
return self
}
self.resetOptions()
self.boolean = function (bools) {
options.boolean.push.apply(options.boolean, [].concat(bools))
return self
}
self.array = function (arrays) {
options.array.push.apply(options.array, [].concat(arrays))
return self
}
self.nargs = function (key, n) {
if (typeof key === 'object') {
Object.keys(key).forEach(function (k) {
self.nargs(k, key[k])
})
} else {
options.narg[key] = n
}
return self
}
self.choices = function (key, values) {
if (typeof key === 'object') {
Object.keys(key).forEach(function (k) {
self.choices(k, key[k])
})
} else {
options.choices[key] = (options.choices[key] || []).concat(values)
}
return self
}
self.normalize = function (strings) {
options.normalize.push.apply(options.normalize, [].concat(strings))
return self
}
self.config = function (key, msg, parseFn) {
if (typeof msg === 'function') {
parseFn = msg
msg = null
}
self.describe(key, msg || usage.deferY18nLookup('Path to JSON config file'))
;(Array.isArray(key) ? key : [key]).forEach(function (k) {
options.config[k] = parseFn || true
})
return self
}
self.example = function (cmd, description) {
usage.example(cmd, description)
return self
}
self.command = function (cmd, description, fn) {
if (description !== false) {
usage.command(cmd, description)
}
if (fn) commandHandlers[cmd] = fn
return self
}
var commandHandlers = {}
self.getCommandHandlers = function () {
return commandHandlers
}
self.string = function (strings) {
options.string.push.apply(options.string, [].concat(strings))
return self
}
self.default = function (key, value, defaultDescription) {
if (typeof key === 'object') {
Object.keys(key).forEach(function (k) {
self.default(k, key[k])
})
} else {
if (defaultDescription) options.defaultDescription[key] = defaultDescription
if (typeof value === 'function') {
if (!options.defaultDescription[key]) options.defaultDescription[key] = usage.functionDescription(value)
value = value.call()
}
options.default[key] = value
}
return self
}
self.alias = function (x, y) {
if (typeof x === 'object') {
Object.keys(x).forEach(function (key) {
self.alias(key, x[key])
})
} else {
// perhaps 'x' is already an alias in another list?
// if so we should append to x's list.
var aliases = null
Object.keys(options.alias).forEach(function (key) {
if (~options.alias[key].indexOf(x)) aliases = options.alias[key]
})
if (aliases) { // x was an alias itself.
aliases.push(y)
} else { // x is a new alias key.
options.alias[x] = (options.alias[x] || []).concat(y)
}
// wait! perhaps we've created two lists of aliases
// that reference each other?
if (options.alias[y]) {
Array.prototype.push.apply((options.alias[x] || aliases), options.alias[y])
delete options.alias[y]
}
}
return self
}
self.count = function (counts) {
options.count.push.apply(options.count, [].concat(counts))
return self
}
var demanded = {}
self.demand = self.required = self.require = function (keys, max, msg) {
// you can optionally provide a 'max' key,
// which will raise an exception if too many '_'
// options are provided.
if (typeof max !== 'number') {
msg = max
max = Infinity
}
if (typeof keys === 'number') {
if (!demanded._) demanded._ = { count: 0, msg: null, max: max }
demanded._.count = keys
demanded._.msg = msg
} else if (Array.isArray(keys)) {
keys.forEach(function (key) {
self.demand(key, msg)
})
} else {
if (typeof msg === 'string') {
demanded[keys] = { msg: msg }
} else if (msg === true || typeof msg === 'undefined') {
demanded[keys] = { msg: undefined }
}
}
return self
}
self.getDemanded = function () {
return demanded
}
self.requiresArg = function (requiresArgs) {
options.requiresArg.push.apply(options.requiresArg, [].concat(requiresArgs))
return self
}
self.implies = function (key, value) {
validation.implies(key, value)
return self
}
self.usage = function (msg, opts) {
if (!opts && typeof msg === 'object') {
opts = msg
msg = null
}
usage.usage(msg)
if (opts) self.options(opts)
return self
}
self.epilogue = self.epilog = function (msg) {
usage.epilog(msg)
return self
}
self.fail = function (f) {
usage.failFn(f)
return self
}
self.check = function (f) {
validation.check(f)
return self
}
self.defaults = self.default
self.describe = function (key, desc) {
options.key[key] = true
usage.describe(key, desc)
return self
}
self.parse = function (args) {
return parseArgs(args)
}
self.option = self.options = function (key, opt) {
if (typeof key === 'object') {
Object.keys(key).forEach(function (k) {
self.options(k, key[k])
})
} else {
assert(typeof opt === 'object', 'second argument to option must be an object')
options.key[key] = true // track manually set keys.
if (opt.alias) self.alias(key, opt.alias)
var demand = opt.demand || opt.required || opt.require
if (demand) {
self.demand(key, demand)
} if ('config' in opt) {
self.config(key, opt.configParser)
} if ('default' in opt) {
self.default(key, opt.default)
} if ('nargs' in opt) {
self.nargs(key, opt.nargs)
} if ('choices' in opt) {
self.choices(key, opt.choices)
} if ('group' in opt) {
self.group(key, opt.group)
} if (opt.boolean || opt.type === 'boolean') {
self.boolean(key)
if (opt.alias) self.boolean(opt.alias)
} if (opt.array || opt.type === 'array') {
self.array(key)
if (opt.alias) self.array(opt.alias)
} if (opt.string || opt.type === 'string') {
self.string(key)
if (opt.alias) self.string(opt.alias)
} if (opt.count || opt.type === 'count') {
self.count(key)
} if (opt.defaultDescription) {
options.defaultDescription[key] = opt.defaultDescription
}
var desc = opt.describe || opt.description || opt.desc
if (desc) {
self.describe(key, desc)
}
if (opt.requiresArg) {
self.requiresArg(key)
}
}
return self
}
self.getOptions = function () {
return options
}
var groups = {}
self.group = function (opts, groupName) {
var seen = {}
groups[groupName] = (groups[groupName] || []).concat(opts).filter(function (key) {
if (seen[key]) return false
return (seen[key] = true)
})
return self
}
self.getGroups = function () {
return groups
}
// as long as options.envPrefix is not undefined,
// parser will apply env vars matching prefix to argv
self.env = function (prefix) {
if (prefix === false) options.envPrefix = undefined
else options.envPrefix = prefix || ''
return self
}
self.wrap = function (cols) {
usage.wrap(cols)
return self
}
var strict = false
self.strict = function () {
strict = true
return self
}
self.getStrict = function () {
return strict
}
self.showHelp = function (level) {
if (!self.parsed) parseArgs(processArgs) // run parser, if it has not already been executed.
usage.showHelp(level)
return self
}
var versionOpt = null
self.version = function (ver, opt, msg) {
versionOpt = opt || 'version'
usage.version(ver)
self.boolean(versionOpt)
self.describe(versionOpt, msg || usage.deferY18nLookup('Show version number'))
return self
}
var helpOpt = null
self.addHelpOpt = function (opt, msg) {
helpOpt = opt
self.boolean(opt)
self.describe(opt, msg || usage.deferY18nLookup('Show help'))
return self
}
self.showHelpOnFail = function (enabled, message) {
usage.showHelpOnFail(enabled, message)
return self
}
var exitProcess = true
self.exitProcess = function (enabled) {
if (typeof enabled !== 'boolean') {
enabled = true
}
exitProcess = enabled
return self
}
self.getExitProcess = function () {
return exitProcess
}
self.help = function () {
if (arguments.length > 0) return self.addHelpOpt.apply(self, arguments)
if (!self.parsed) parseArgs(processArgs) // run parser, if it has not already been executed.
return usage.help()
}
var completionCommand = null
self.completion = function (cmd, desc, fn) {
// a function to execute when generating
// completions can be provided as the second
// or third argument to completion.
if (typeof desc === 'function') {
fn = desc
desc = null
}
// register the completion command.
completionCommand = cmd || 'completion'
if (!desc && desc !== false) {
desc = 'generate bash completion script'
}
self.command(completionCommand, desc)
// a function can be provided
if (fn) completion.registerFunction(fn)
return self
}
self.showCompletionScript = function ($0) {
$0 = $0 || self.$0
console.log(completion.generateCompletionScript($0))
return self
}
self.locale = function (locale) {
if (arguments.length === 0) {
guessLocale()
return y18n.getLocale()
}
detectLocale = false
y18n.setLocale(locale)
return self
}
self.updateStrings = self.updateLocale = function (obj) {
detectLocale = false
y18n.updateLocale(obj)
return self
}
var detectLocale = true
self.detectLocale = function (detect) {
detectLocale = detect
return self
}
self.getDetectLocale = function () {
return detectLocale
}
self.getUsageInstance = function () {
return usage
}
self.getValidationInstance = function () {
return validation
}
self.terminalWidth = function () {
return require('window-size').width
}
Object.defineProperty(self, 'argv', {
get: function () {
var args = null
try {
args = parseArgs(processArgs)
} catch (err) {
usage.fail(err.message)
}
return args
},
enumerable: true
})
function parseArgs (args) {
args = normalizeArgs(args)
var parsed = Parser(args, options, y18n)
var argv = parsed.argv
var aliases = parsed.aliases
argv.$0 = self.$0
self.parsed = parsed
guessLocale() // guess locale lazily, so that it can be turned off in chain.
// while building up the argv object, there
// are two passes through the parser. If completion
// is being performed short-circuit on the first pass.
if (completionCommand &&
(process.argv.join(' ')).indexOf(completion.completionKey) !== -1 &&
!argv[completion.completionKey]) {
return argv
}
// if there's a handler associated with a
// command defer processing to it.
var handlerKeys = Object.keys(self.getCommandHandlers())
for (var i = 0, command; (command = handlerKeys[i]) !== undefined; i++) {
if (~argv._.indexOf(command)) {
runCommand(command, self, argv)
return self.argv
}
}
// generate a completion script for adding to ~/.bashrc.
if (completionCommand && ~argv._.indexOf(completionCommand) && !argv[completion.completionKey]) {
self.showCompletionScript()
if (exitProcess) {
process.exit(0)
}
}
// we must run completions first, a user might
// want to complete the --help or --version option.
if (completion.completionKey in argv) {
// we allow for asynchronous completions,
// e.g., loading in a list of commands from an API.
completion.getCompletion(function (completions) {
;(completions || []).forEach(function (completion) {
console.log(completion)
})
if (exitProcess) {
process.exit(0)
}
})
return
}
var helpOrVersion = false
Object.keys(argv).forEach(function (key) {
if (key === helpOpt && argv[key]) {
helpOrVersion = true
self.showHelp('log')
if (exitProcess) {
process.exit(0)
}
} else if (key === versionOpt && argv[key]) {
helpOrVersion = true
usage.showVersion()
if (exitProcess) {
process.exit(0)
}
}
})
// If the help or version options where used and exitProcess is false,
// we won't run validations
if (!helpOrVersion) {
if (parsed.error) throw parsed.error
// if we're executed via bash completion, don't
// bother with validation.
if (!argv[completion.completionKey]) {
validation.nonOptionCount(argv)
validation.missingArgumentValue(argv)
validation.requiredArguments(argv)
if (strict) validation.unknownArguments(argv, aliases)
validation.customChecks(argv, aliases)
validation.limitedChoices(argv)
validation.implications(argv)
}
}
setPlaceholderKeys(argv)
return argv
}
function guessLocale () {
if (!detectLocale) return
try {
var osLocale = require('os-locale')
self.locale(osLocale.sync({ spawn: false }))
} catch (err) {
// if we explode looking up locale just noop
// we'll keep using the default language 'en'.
}
}
function runCommand (command, yargs, argv) {
setPlaceholderKeys(argv)
yargs.getCommandHandlers()[command](yargs.reset(), argv)
}
function setPlaceholderKeys (argv) {
Object.keys(options.key).forEach(function (key) {
// don't set placeholder keys for dot
// notation options 'foo.bar'.
if (~key.indexOf('.')) return
if (typeof argv[key] === 'undefined') argv[key] = undefined
})
}
function normalizeArgs (args) {
if (typeof args === 'string') {
return tokenizeArgString(args)
}
return args
}
singletonify(self)
return self
}
// rebase an absolute path to a relative one with respect to a base directory
// exported for tests
exports.rebase = rebase
function rebase (base, dir) {
return path.relative(base, dir)
}
/* Hack an instance of Argv with process.argv into Argv
so people can do
require('yargs')(['--beeble=1','-z','zizzle']).argv
to parse a list of args and
require('yargs').argv
to get a parsed version of process.argv.
*/
function singletonify (inst) {
Object.keys(inst).forEach(function (key) {
if (key === 'argv') {
Argv.__defineGetter__(key, inst.__lookupGetter__(key))
} else {
Argv[key] = typeof inst[key] === 'function' ? inst[key].bind(inst) : inst[key]
}
})
}

View File

@ -0,0 +1,91 @@
var fs = require('fs')
var path = require('path')
// add bash completions to your
// yargs-powered applications.
module.exports = function (yargs, usage) {
var self = {
completionKey: 'get-yargs-completions'
}
// get a list of completion commands.
self.getCompletion = function (done) {
var completions = []
var current = process.argv[process.argv.length - 1]
var previous = process.argv.slice(process.argv.indexOf('--' + self.completionKey) + 1)
var argv = yargs.parse(previous)
// a custom completion function can be provided
// to completion().
if (completionFunction) {
if (completionFunction.length < 3) {
var result = completionFunction(current, argv)
// promise based completion function.
if (typeof result.then === 'function') {
return result.then(function (list) {
process.nextTick(function () { done(list) })
}).catch(function (err) {
process.nextTick(function () { throw err })
})
}
// synchronous completion function.
return done(result)
} else {
// asynchronous completion function
return completionFunction(current, argv, function (completions) {
done(completions)
})
}
}
var handlers = yargs.getCommandHandlers()
for (var i = 0, ii = previous.length; i < ii; ++i) {
if (handlers[previous[i]]) {
return handlers[previous[i]](yargs.reset())
}
}
if (!current.match(/^-/)) {
usage.getCommands().forEach(function (command) {
if (previous.indexOf(command[0]) === -1) {
completions.push(command[0])
}
})
}
if (current.match(/^-/)) {
Object.keys(yargs.getOptions().key).forEach(function (key) {
completions.push('--' + key)
})
}
done(completions)
}
// generate the completion script to add to your .bashrc.
self.generateCompletionScript = function ($0) {
var script = fs.readFileSync(
path.resolve(__dirname, '../completion.sh.hbs'),
'utf-8'
)
var name = path.basename($0)
// add ./to applications not yet installed as bin.
if ($0.match(/\.js$/)) $0 = './' + $0
script = script.replace(/{{app_name}}/g, name)
return script.replace(/{{app_path}}/g, $0)
}
// register a function to perform your own custom
// completions., this function can be either
// synchrnous or asynchronous.
var completionFunction = null
self.registerFunction = function (fn) {
completionFunction = fn
}
return self
}

520
node_modules/nunjucks/node_modules/yargs/lib/parser.js generated vendored Normal file
View File

@ -0,0 +1,520 @@
// fancy-pants parsing of argv, originally forked
// from minimist: https://www.npmjs.com/package/minimist
var camelCase = require('camelcase')
var path = require('path')
function increment (orig) {
return orig !== undefined ? orig + 1 : 0
}
module.exports = function (args, opts, y18n) {
if (!opts) opts = {}
var __ = y18n.__
var error = null
var flags = { arrays: {}, bools: {}, strings: {}, counts: {}, normalize: {}, configs: {}, defaulted: {} }
;[].concat(opts['array']).filter(Boolean).forEach(function (key) {
flags.arrays[key] = true
})
;[].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
flags.bools[key] = true
})
;[].concat(opts.string).filter(Boolean).forEach(function (key) {
flags.strings[key] = true
})
;[].concat(opts.count).filter(Boolean).forEach(function (key) {
flags.counts[key] = true
})
;[].concat(opts.normalize).filter(Boolean).forEach(function (key) {
flags.normalize[key] = true
})
Object.keys(opts.config).forEach(function (k) {
flags.configs[k] = opts.config[k]
})
var aliases = {}
var newAliases = {}
extendAliases(opts.key)
extendAliases(opts.alias)
extendAliases(opts.default)
var defaults = opts['default'] || {}
Object.keys(defaults).forEach(function (key) {
if (/-/.test(key) && !opts.alias[key]) {
aliases[key] = aliases[key] || []
}
(aliases[key] || []).forEach(function (alias) {
defaults[alias] = defaults[key]
})
})
var argv = { _: [] }
Object.keys(flags.bools).forEach(function (key) {
setArg(key, !(key in defaults) ? false : defaults[key])
setDefaulted(key)
})
var notFlags = []
if (args.indexOf('--') !== -1) {
notFlags = args.slice(args.indexOf('--') + 1)
args = args.slice(0, args.indexOf('--'))
}
for (var i = 0; i < args.length; i++) {
var arg = args[i]
var broken
var key
var letters
var m
var next
var value
// -- seperated by =
if (arg.match(/^--.+=/)) {
// Using [\s\S] instead of . because js doesn't support the
// 'dotall' regex modifier. See:
// http://stackoverflow.com/a/1068308/13216
m = arg.match(/^--([^=]+)=([\s\S]*)$/)
// nargs format = '--f=monkey washing cat'
if (checkAllAliases(m[1], opts.narg)) {
args.splice(i + 1, m[1], m[2])
i = eatNargs(i, m[1], args)
// arrays format = '--f=a b c'
} else if (checkAllAliases(m[1], flags.arrays) && args.length > i + 1) {
args.splice(i + 1, m[1], m[2])
i = eatArray(i, m[1], args)
} else {
setArg(m[1], m[2])
}
} else if (arg.match(/^--no-.+/)) {
key = arg.match(/^--no-(.+)/)[1]
setArg(key, false)
// -- seperated by space.
} else if (arg.match(/^--.+/)) {
key = arg.match(/^--(.+)/)[1]
// nargs format = '--foo a b c'
if (checkAllAliases(key, opts.narg)) {
i = eatNargs(i, key, args)
// array format = '--foo a b c'
} else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
i = eatArray(i, key, args)
} else {
next = args[i + 1]
if (next !== undefined && !next.match(/^-/) &&
!checkAllAliases(key, flags.bools) &&
!checkAllAliases(key, flags.counts)) {
setArg(key, next)
i++
} else if (/^(true|false)$/.test(next)) {
setArg(key, next)
i++
} else {
setArg(key, defaultForType(guessType(key, flags)))
}
}
// dot-notation flag seperated by '='.
} else if (arg.match(/^-.\..+=/)) {
m = arg.match(/^-([^=]+)=([\s\S]*)$/)
setArg(m[1], m[2])
// dot-notation flag seperated by space.
} else if (arg.match(/^-.\..+/)) {
next = args[i + 1]
key = arg.match(/^-(.\..+)/)[1]
if (next !== undefined && !next.match(/^-/) &&
!checkAllAliases(key, flags.bools) &&
!checkAllAliases(key, flags.counts)) {
setArg(key, next)
i++
} else {
setArg(key, defaultForType(guessType(key, flags)))
}
} else if (arg.match(/^-[^-]+/)) {
letters = arg.slice(1, -1).split('')
broken = false
for (var j = 0; j < letters.length; j++) {
next = arg.slice(j + 2)
if (letters[j + 1] && letters[j + 1] === '=') {
value = arg.slice(j + 3)
key = letters[j]
// nargs format = '-f=monkey washing cat'
if (checkAllAliases(letters[j], opts.narg)) {
args.splice(i + 1, 0, value)
i = eatNargs(i, key, args)
// array format = '-f=a b c'
} else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
args.splice(i + 1, 0, value)
i = eatArray(i, key, args)
} else {
setArg(key, value)
}
broken = true
break
}
if (next === '-') {
setArg(letters[j], next)
continue
}
if (/[A-Za-z]/.test(letters[j]) &&
/-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
setArg(letters[j], next)
broken = true
break
}
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
setArg(letters[j], arg.slice(j + 2))
broken = true
break
} else {
setArg(letters[j], defaultForType(guessType(letters[j], flags)))
}
}
key = arg.slice(-1)[0]
if (!broken && key !== '-') {
// nargs format = '-f a b c'
if (checkAllAliases(key, opts.narg)) {
i = eatNargs(i, key, args)
// array format = '-f a b c'
} else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
i = eatArray(i, key, args)
} else {
if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) &&
!checkAllAliases(key, flags.bools) &&
!checkAllAliases(key, flags.counts)) {
setArg(key, args[i + 1])
i++
} else if (args[i + 1] && /true|false/.test(args[i + 1])) {
setArg(key, args[i + 1])
i++
} else {
setArg(key, defaultForType(guessType(key, flags)))
}
}
}
} else {
argv._.push(
flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
)
}
}
// order of precedence:
// 1. command line arg
// 2. value from config file
// 3. value from env var
// 4. configured default value
applyEnvVars(opts, argv, true) // special case: check env vars that point to config file
setConfig(argv)
applyEnvVars(opts, argv, false)
applyDefaultsAndAliases(argv, aliases, defaults)
Object.keys(flags.counts).forEach(function (key) {
setArg(key, defaults[key])
})
notFlags.forEach(function (key) {
argv._.push(key)
})
// how many arguments should we consume, based
// on the nargs option?
function eatNargs (i, key, args) {
var toEat = checkAllAliases(key, opts.narg)
if (args.length - (i + 1) < toEat) error = Error(__('Not enough arguments following: %s', key))
for (var ii = i + 1; ii < (toEat + i + 1); ii++) {
setArg(key, args[ii])
}
return (i + toEat)
}
// if an option is an array, eat all non-hyphenated arguments
// following it... YUM!
// e.g., --foo apple banana cat becomes ["apple", "banana", "cat"]
function eatArray (i, key, args) {
for (var ii = i + 1; ii < args.length; ii++) {
if (/^-/.test(args[ii])) break
i = ii
setArg(key, args[ii])
}
return i
}
function setArg (key, val) {
unsetDefaulted(key)
// handle parsing boolean arguments --foo=true --bar false.
if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
if (typeof val === 'string') val = val === 'true'
}
if (/-/.test(key) && !(aliases[key] && aliases[key].length)) {
var c = camelCase(key)
aliases[key] = [c]
newAliases[c] = true
}
var value = !checkAllAliases(key, flags.strings) && isNumber(val) ? Number(val) : val
if (checkAllAliases(key, flags.counts)) {
value = increment
}
var splitKey = key.split('.')
setKey(argv, splitKey, value)
// alias references an inner-value within
// a dot-notation object. see #279.
if (~key.indexOf('.') && aliases[key]) {
aliases[key].forEach(function (x) {
x = x.split('.')
setKey(argv, x, value)
})
}
;(aliases[splitKey[0]] || []).forEach(function (x) {
x = x.split('.')
// handle populating dot notation for both
// the key and its aliases.
if (splitKey.length > 1) {
var a = [].concat(splitKey)
a.shift() // nuke the old key.
x = x.concat(a)
}
setKey(argv, x, value)
})
var keys = [key].concat(aliases[key] || [])
for (var i = 0, l = keys.length; i < l; i++) {
if (flags.normalize[keys[i]]) {
keys.forEach(function (key) {
argv.__defineSetter__(key, function (v) {
val = path.normalize(v)
})
argv.__defineGetter__(key, function () {
return typeof val === 'string' ? path.normalize(val) : val
})
})
break
}
}
}
// set args from config.json file, this should be
// applied last so that defaults can be applied.
function setConfig (argv) {
var configLookup = {}
// expand defaults/aliases, in-case any happen to reference
// the config.json file.
applyDefaultsAndAliases(configLookup, aliases, defaults)
Object.keys(flags.configs).forEach(function (configKey) {
var configPath = argv[configKey] || configLookup[configKey]
if (configPath) {
try {
var config = null
var resolvedConfigPath = path.resolve(process.cwd(), configPath)
if (typeof flags.configs[configKey] === 'function') {
try {
config = flags.configs[configKey](resolvedConfigPath)
} catch (e) {
config = e
}
if (config instanceof Error) {
error = config
return
}
} else {
config = require(resolvedConfigPath)
}
Object.keys(config).forEach(function (key) {
// setting arguments via CLI takes precedence over
// values within the config file.
if (argv[key] === undefined || (flags.defaulted[key])) {
delete argv[key]
setArg(key, config[key])
}
})
} catch (ex) {
if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath))
}
}
})
}
function applyEnvVars (opts, argv, configOnly) {
if (typeof opts.envPrefix === 'undefined') return
var prefix = typeof opts.envPrefix === 'string' ? opts.envPrefix : ''
Object.keys(process.env).forEach(function (envVar) {
if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) {
var key = camelCase(envVar.substring(prefix.length))
if (((configOnly && flags.configs[key]) || !configOnly) && (!(key in argv) || flags.defaulted[key])) {
setArg(key, process.env[envVar])
}
}
})
}
function applyDefaultsAndAliases (obj, aliases, defaults) {
Object.keys(defaults).forEach(function (key) {
if (!hasKey(obj, key.split('.'))) {
setKey(obj, key.split('.'), defaults[key])
;(aliases[key] || []).forEach(function (x) {
if (hasKey(obj, x.split('.'))) return
setKey(obj, x.split('.'), defaults[key])
})
}
})
}
function hasKey (obj, keys) {
var o = obj
keys.slice(0, -1).forEach(function (key) {
o = (o[key] || {})
})
var key = keys[keys.length - 1]
if (typeof o !== 'object') return false
else return key in o
}
function setKey (obj, keys, value) {
var o = obj
keys.slice(0, -1).forEach(function (key) {
if (o[key] === undefined) o[key] = {}
o = o[key]
})
var key = keys[keys.length - 1]
if (value === increment) {
o[key] = increment(o[key])
} else if (o[key] === undefined && checkAllAliases(key, flags.arrays)) {
o[key] = Array.isArray(value) ? value : [value]
} else if (o[key] === undefined || typeof o[key] === 'boolean') {
o[key] = value
} else if (Array.isArray(o[key])) {
o[key].push(value)
} else {
o[key] = [ o[key], value ]
}
}
// extend the aliases list with inferred aliases.
function extendAliases (obj) {
Object.keys(obj || {}).forEach(function (key) {
// short-circuit if we've already added a key
// to the aliases array, for example it might
// exist in both 'opts.default' and 'opts.key'.
if (aliases[key]) return
aliases[key] = [].concat(opts.alias[key] || [])
// For "--option-name", also set argv.optionName
aliases[key].concat(key).forEach(function (x) {
if (/-/.test(x)) {
var c = camelCase(x)
aliases[key].push(c)
newAliases[c] = true
}
})
aliases[key].forEach(function (x) {
aliases[x] = [key].concat(aliases[key].filter(function (y) {
return x !== y
}))
})
})
}
// check if a flag is set for any of a key's aliases.
function checkAllAliases (key, flag) {
var isSet = false
var toCheck = [].concat(aliases[key] || [], key)
toCheck.forEach(function (key) {
if (flag[key]) isSet = flag[key]
})
return isSet
}
function setDefaulted (key) {
[].concat(aliases[key] || [], key).forEach(function (k) {
flags.defaulted[k] = true
})
}
function unsetDefaulted (key) {
[].concat(aliases[key] || [], key).forEach(function (k) {
delete flags.defaulted[k]
})
}
// return a default value, given the type of a flag.,
// e.g., key of type 'string' will default to '', rather than 'true'.
function defaultForType (type) {
var def = {
boolean: true,
string: '',
array: []
}
return def[type]
}
// given a flag, enforce a default type.
function guessType (key, flags) {
var type = 'boolean'
if (flags.strings && flags.strings[key]) type = 'string'
else if (flags.arrays && flags.arrays[key]) type = 'array'
return type
}
function isNumber (x) {
if (typeof x === 'number') return true
if (/^0x[0-9a-f]+$/i.test(x)) return true
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x)
}
return {
argv: argv,
aliases: aliases,
error: error,
newAliases: newAliases
}
}

View File

@ -0,0 +1,32 @@
// take an un-split argv string and tokenize it.
module.exports = function (argString) {
var i = 0
var c = null
var opening = null
var args = []
for (var ii = 0; ii < argString.length; ii++) {
c = argString.charAt(ii)
// split on spaces unless we're in quotes.
if (c === ' ' && !opening) {
i++
continue
}
// don't split the string if we're in matching
// opening or closing single and double quotes.
if (c === opening) {
opening = null
continue
} else if ((c === "'" || c === '"') && !opening) {
opening = c
continue
}
if (!args[i]) args[i] = ''
args[i] += c
}
return args
}

383
node_modules/nunjucks/node_modules/yargs/lib/usage.js generated vendored Normal file
View File

@ -0,0 +1,383 @@
// this file handles outputting usage instructions,
// failures, etc. keeps logging in one place.
var cliui = require('cliui')
var decamelize = require('decamelize')
var stringWidth = require('string-width')
var wsize = require('window-size')
module.exports = function (yargs, y18n) {
var __ = y18n.__
var self = {}
// methods for ouputting/building failure message.
var fails = []
self.failFn = function (f) {
fails.push(f)
}
var failMessage = null
var showHelpOnFail = true
self.showHelpOnFail = function (enabled, message) {
if (typeof enabled === 'string') {
message = enabled
enabled = true
} else if (typeof enabled === 'undefined') {
enabled = true
}
failMessage = message
showHelpOnFail = enabled
return self
}
var failureOutput = false
self.fail = function (msg) {
if (fails.length) {
fails.forEach(function (f) {
f(msg)
})
} else {
// don't output failure message more than once
if (!failureOutput) {
failureOutput = true
if (showHelpOnFail) yargs.showHelp('error')
if (msg) console.error(msg)
if (failMessage) {
if (msg) console.error('')
console.error(failMessage)
}
}
if (yargs.getExitProcess()) {
process.exit(1)
} else {
throw new Error(msg)
}
}
}
// methods for ouputting/building help (usage) message.
var usage
self.usage = function (msg) {
usage = msg
}
var examples = []
self.example = function (cmd, description) {
examples.push([cmd, description || ''])
}
var commands = []
self.command = function (cmd, description) {
commands.push([cmd, description || ''])
}
self.getCommands = function () {
return commands
}
var descriptions = {}
self.describe = function (key, desc) {
if (typeof key === 'object') {
Object.keys(key).forEach(function (k) {
self.describe(k, key[k])
})
} else {
descriptions[key] = desc
}
}
self.getDescriptions = function () {
return descriptions
}
var epilog
self.epilog = function (msg) {
epilog = msg
}
var wrap = windowWidth()
self.wrap = function (cols) {
wrap = cols
}
var deferY18nLookupPrefix = '__yargsString__:'
self.deferY18nLookup = function (str) {
return deferY18nLookupPrefix + str
}
var defaultGroup = 'Options:'
self.help = function () {
normalizeAliases()
var demanded = yargs.getDemanded()
var groups = yargs.getGroups()
var options = yargs.getOptions()
var keys = Object.keys(
Object.keys(descriptions)
.concat(Object.keys(demanded))
.concat(Object.keys(options.default))
.reduce(function (acc, key) {
if (key !== '_') acc[key] = true
return acc
}, {})
)
var ui = cliui({
width: wrap,
wrap: !!wrap
})
// the usage string.
if (usage) {
var u = usage.replace(/\$0/g, yargs.$0)
ui.div(u + '\n')
}
// your application's commands, i.e., non-option
// arguments populated in '_'.
if (commands.length) {
ui.div(__('Commands:'))
commands.forEach(function (command) {
ui.div(
{text: command[0], padding: [0, 2, 0, 2], width: maxWidth(commands) + 4},
{text: command[1]}
)
})
ui.div()
}
// perform some cleanup on the keys array, making it
// only include top-level keys not their aliases.
var aliasKeys = (Object.keys(options.alias) || [])
.concat(Object.keys(yargs.parsed.newAliases) || [])
keys = keys.filter(function (key) {
return !yargs.parsed.newAliases[key] && aliasKeys.every(function (alias) {
return (options.alias[alias] || []).indexOf(key) === -1
})
})
// populate 'Options:' group with any keys that have not
// explicitly had a group set.
if (!groups[defaultGroup]) groups[defaultGroup] = []
addUngroupedKeys(keys, options.alias, groups)
// display 'Options:' table along with any custom tables:
Object.keys(groups).forEach(function (groupName) {
if (!groups[groupName].length) return
ui.div(__(groupName))
// if we've grouped the key 'f', but 'f' aliases 'foobar',
// normalizedKeys should contain only 'foobar'.
var normalizedKeys = groups[groupName].map(function (key) {
if (~aliasKeys.indexOf(key)) return key
for (var i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) {
if (~(options.alias[aliasKey] || []).indexOf(key)) return aliasKey
}
return key
})
// actually generate the switches string --foo, -f, --bar.
var switches = normalizedKeys.reduce(function (acc, key) {
acc[key] = [ key ].concat(options.alias[key] || [])
.map(function (sw) {
return (sw.length > 1 ? '--' : '-') + sw
})
.join(', ')
return acc
}, {})
normalizedKeys.forEach(function (key) {
var kswitch = switches[key]
var desc = descriptions[key] || ''
var type = null
if (~desc.lastIndexOf(deferY18nLookupPrefix)) desc = __(desc.substring(deferY18nLookupPrefix.length))
if (~options.boolean.indexOf(key)) type = '[' + __('boolean') + ']'
if (~options.count.indexOf(key)) type = '[' + __('count') + ']'
if (~options.string.indexOf(key)) type = '[' + __('string') + ']'
if (~options.normalize.indexOf(key)) type = '[' + __('string') + ']'
if (~options.array.indexOf(key)) type = '[' + __('array') + ']'
var extra = [
type,
demanded[key] ? '[' + __('required') + ']' : null,
options.choices && options.choices[key] ? '[' + __('choices:') + ' ' +
self.stringifiedValues(options.choices[key]) + ']' : null,
defaultString(options.default[key], options.defaultDescription[key])
].filter(Boolean).join(' ')
ui.span(
{text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches) + 4},
desc
)
if (extra) ui.div({text: extra, padding: [0, 0, 0, 2], align: 'right'})
else ui.div()
})
ui.div()
})
// describe some common use-cases for your application.
if (examples.length) {
ui.div(__('Examples:'))
examples.forEach(function (example) {
example[0] = example[0].replace(/\$0/g, yargs.$0)
})
examples.forEach(function (example) {
ui.div(
{text: example[0], padding: [0, 2, 0, 2], width: maxWidth(examples) + 4},
example[1]
)
})
ui.div()
}
// the usage string.
if (epilog) {
var e = epilog.replace(/\$0/g, yargs.$0)
ui.div(e + '\n')
}
return ui.toString()
}
// return the maximum width of a string
// in the left-hand column of a table.
function maxWidth (table) {
var width = 0
// table might be of the form [leftColumn],
// or {key: leftColumn}}
if (!Array.isArray(table)) {
table = Object.keys(table).map(function (key) {
return [table[key]]
})
}
table.forEach(function (v) {
width = Math.max(stringWidth(v[0]), width)
})
// if we've enabled 'wrap' we should limit
// the max-width of the left-column.
if (wrap) width = Math.min(width, parseInt(wrap * 0.5, 10))
return width
}
// make sure any options set for aliases,
// are copied to the keys being aliased.
function normalizeAliases () {
var demanded = yargs.getDemanded()
var options = yargs.getOptions()
;(Object.keys(options.alias) || []).forEach(function (key) {
options.alias[key].forEach(function (alias) {
// copy descriptions.
if (descriptions[alias]) self.describe(key, descriptions[alias])
// copy demanded.
if (demanded[alias]) yargs.demand(key, demanded[alias].msg)
// type messages.
if (~options.boolean.indexOf(alias)) yargs.boolean(key)
if (~options.count.indexOf(alias)) yargs.count(key)
if (~options.string.indexOf(alias)) yargs.string(key)
if (~options.normalize.indexOf(alias)) yargs.normalize(key)
if (~options.array.indexOf(alias)) yargs.array(key)
})
})
}
// given a set of keys, place any keys that are
// ungrouped under the 'Options:' grouping.
function addUngroupedKeys (keys, aliases, groups) {
var groupedKeys = []
var toCheck = null
Object.keys(groups).forEach(function (group) {
groupedKeys = groupedKeys.concat(groups[group])
})
keys.forEach(function (key) {
toCheck = [key].concat(aliases[key])
if (!toCheck.some(function (k) {
return groupedKeys.indexOf(k) !== -1
})) {
groups[defaultGroup].push(key)
}
})
return groupedKeys
}
self.showHelp = function (level) {
level = level || 'error'
console[level](self.help())
}
self.functionDescription = function (fn) {
var description = fn.name ? decamelize(fn.name, '-') : __('generated-value')
return ['(', description, ')'].join('')
}
self.stringifiedValues = function (values, separator) {
var string = ''
var sep = separator || ', '
var array = [].concat(values)
if (!values || !array.length) return string
array.forEach(function (value) {
if (string.length) string += sep
string += JSON.stringify(value)
})
return string
}
// format the default-value-string displayed in
// the right-hand column.
function defaultString (value, defaultDescription) {
var string = '[' + __('default:') + ' '
if (value === undefined && !defaultDescription) return null
if (defaultDescription) {
string += defaultDescription
} else {
switch (typeof value) {
case 'string':
string += JSON.stringify(value)
break
case 'object':
string += JSON.stringify(value)
break
default:
string += value
}
}
return string + ']'
}
// guess the width of the console window, max-width 80.
function windowWidth () {
return wsize.width ? Math.min(80, wsize.width) : null
}
// logic for displaying application version.
var version = null
self.version = function (ver, opt, msg) {
version = ver
}
self.showVersion = function () {
if (typeof version === 'function') console.log(version())
else console.log(version)
}
return self
}

View File

@ -0,0 +1,249 @@
// validation-type-stuff, missing params,
// bad implications, custom checks.
module.exports = function (yargs, usage, y18n) {
var __ = y18n.__
var __n = y18n.__n
var self = {}
// validate appropriate # of non-option
// arguments were provided, i.e., '_'.
self.nonOptionCount = function (argv) {
var demanded = yargs.getDemanded()
var _s = argv._.length
if (demanded._ && (_s < demanded._.count || _s > demanded._.max)) {
if (demanded._.msg !== undefined) {
usage.fail(demanded._.msg)
} else if (_s < demanded._.count) {
usage.fail(
__('Not enough non-option arguments: got %s, need at least %s', argv._.length, demanded._.count)
)
} else {
usage.fail(
__('Too many non-option arguments: got %s, maximum of %s', argv._.length, demanded._.max)
)
}
}
}
// make sure that any args that require an
// value (--foo=bar), have a value.
self.missingArgumentValue = function (argv) {
var defaultValues = [true, false, '']
var options = yargs.getOptions()
if (options.requiresArg.length > 0) {
var missingRequiredArgs = []
options.requiresArg.forEach(function (key) {
var value = argv[key]
// if a value is explicitly requested,
// flag argument as missing if it does not
// look like foo=bar was entered.
if (~defaultValues.indexOf(value) ||
(Array.isArray(value) && !value.length)) {
missingRequiredArgs.push(key)
}
})
if (missingRequiredArgs.length > 0) {
usage.fail(__n(
'Missing argument value: %s',
'Missing argument values: %s',
missingRequiredArgs.length,
missingRequiredArgs.join(', ')
))
}
}
}
// make sure all the required arguments are present.
self.requiredArguments = function (argv) {
var demanded = yargs.getDemanded()
var missing = null
Object.keys(demanded).forEach(function (key) {
if (!argv.hasOwnProperty(key)) {
missing = missing || {}
missing[key] = demanded[key]
}
})
if (missing) {
var customMsgs = []
Object.keys(missing).forEach(function (key) {
var msg = missing[key].msg
if (msg && customMsgs.indexOf(msg) < 0) {
customMsgs.push(msg)
}
})
var customMsg = customMsgs.length ? '\n' + customMsgs.join('\n') : ''
usage.fail(__n(
'Missing required argument: %s',
'Missing required arguments: %s',
Object.keys(missing).length,
Object.keys(missing).join(', ') + customMsg
))
}
}
// check for unknown arguments (strict-mode).
self.unknownArguments = function (argv, aliases) {
var aliasLookup = {}
var descriptions = usage.getDescriptions()
var demanded = yargs.getDemanded()
var unknown = []
Object.keys(aliases).forEach(function (key) {
aliases[key].forEach(function (alias) {
aliasLookup[alias] = key
})
})
Object.keys(argv).forEach(function (key) {
if (key !== '$0' && key !== '_' &&
!descriptions.hasOwnProperty(key) &&
!demanded.hasOwnProperty(key) &&
!aliasLookup.hasOwnProperty(key)) {
unknown.push(key)
}
})
if (unknown.length > 0) {
usage.fail(__n(
'Unknown argument: %s',
'Unknown arguments: %s',
unknown.length,
unknown.join(', ')
))
}
}
// validate arguments limited to enumerated choices
self.limitedChoices = function (argv) {
var options = yargs.getOptions()
var invalid = {}
if (!Object.keys(options.choices).length) return
Object.keys(argv).forEach(function (key) {
if (key !== '$0' && key !== '_' &&
options.choices.hasOwnProperty(key)) {
[].concat(argv[key]).forEach(function (value) {
// TODO case-insensitive configurability
if (options.choices[key].indexOf(value) === -1) {
invalid[key] = (invalid[key] || []).concat(value)
}
})
}
})
var invalidKeys = Object.keys(invalid)
if (!invalidKeys.length) return
var msg = __('Invalid values:')
invalidKeys.forEach(function (key) {
msg += '\n ' + __(
'Argument: %s, Given: %s, Choices: %s',
key,
usage.stringifiedValues(invalid[key]),
usage.stringifiedValues(options.choices[key])
)
})
usage.fail(msg)
}
// custom checks, added using the `check` option on yargs.
var checks = []
self.check = function (f) {
checks.push(f)
}
self.customChecks = function (argv, aliases) {
checks.forEach(function (f) {
try {
var result = f(argv, aliases)
if (!result) {
usage.fail(__('Argument check failed: %s', f.toString()))
} else if (typeof result === 'string') {
usage.fail(result)
}
} catch (err) {
usage.fail(err.message ? err.message : err)
}
})
}
// check implications, argument foo implies => argument bar.
var implied = {}
self.implies = function (key, value) {
if (typeof key === 'object') {
Object.keys(key).forEach(function (k) {
self.implies(k, key[k])
})
} else {
implied[key] = value
}
}
self.getImplied = function () {
return implied
}
self.implications = function (argv) {
var implyFail = []
Object.keys(implied).forEach(function (key) {
var num
var origKey = key
var value = implied[key]
// convert string '1' to number 1
num = Number(key)
key = isNaN(num) ? key : num
if (typeof key === 'number') {
// check length of argv._
key = argv._.length >= key
} else if (key.match(/^--no-.+/)) {
// check if key doesn't exist
key = key.match(/^--no-(.+)/)[1]
key = !argv[key]
} else {
// check if key exists
key = argv[key]
}
num = Number(value)
value = isNaN(num) ? value : num
if (typeof value === 'number') {
value = argv._.length >= value
} else if (value.match(/^--no-.+/)) {
value = value.match(/^--no-(.+)/)[1]
value = !argv[value]
} else {
value = argv[value]
}
if (key && !value) {
implyFail.push(origKey)
}
})
if (implyFail.length) {
var msg = __('Implications failed:') + '\n'
implyFail.forEach(function (key) {
msg += (' ' + key + ' -> ' + implied[key])
})
usage.fail(msg)
}
}
return self
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "Kommandos:",
"Options:": "Optionen:",
"Examples:": "Beispiele:",
"boolean": "boolean",
"count": "Zähler",
"string": "string",
"array": "array",
"required": "erforderlich",
"default:": "Standard:",
"choices:": "Möglichkeiten:",
"generated-value": "Generierter-Wert",
"Not enough non-option arguments: got %s, need at least %s": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
"Too many non-option arguments: got %s, maximum of %s": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
"Missing argument value: %s": {
"one": "Fehlender Argumentwert: %s",
"other": "Fehlende Argumentwerte: %s"
},
"Missing required argument: %s": {
"one": "Fehlendes Argument: %s",
"other": "Fehlende Argumente: %s"
},
"Unknown argument: %s": {
"one": "Unbekanntes Argument: %s",
"other": "Unbekannte Argumente: %s"
},
"Invalid values:": "Unzulässige Werte:",
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s",
"Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s",
"Implications failed:": "Implikationen fehlgeschlagen:",
"Not enough arguments following: %s": "Nicht genügend Argumente nach: %s",
"Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s",
"Path to JSON config file": "Pfad zur JSON-Config Datei",
"Show help": "Hilfe anzeigen",
"Show version number": "Version anzeigen"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "Commands:",
"Options:": "Options:",
"Examples:": "Examples:",
"boolean": "boolean",
"count": "count",
"string": "string",
"array": "array",
"required": "required",
"default:": "default:",
"choices:": "choices:",
"generated-value": "generated-value",
"Not enough non-option arguments: got %s, need at least %s": "Not enough non-option arguments: got %s, need at least %s",
"Too many non-option arguments: got %s, maximum of %s": "Too many non-option arguments: got %s, maximum of %s",
"Missing argument value: %s": {
"one": "Missing argument value: %s",
"other": "Missing argument values: %s"
},
"Missing required argument: %s": {
"one": "Missing required argument: %s",
"other": "Missing required arguments: %s"
},
"Unknown argument: %s": {
"one": "Unknown argument: %s",
"other": "Unknown arguments: %s"
},
"Invalid values:": "Invalid values:",
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s",
"Argument check failed: %s": "Argument check failed: %s",
"Implications failed:": "Implications failed:",
"Not enough arguments following: %s": "Not enough arguments following: %s",
"Invalid JSON config file: %s": "Invalid JSON config file: %s",
"Path to JSON config file": "Path to JSON config file",
"Show help": "Show help",
"Show version number": "Show version number"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "Comandos:",
"Options:": "Opciones:",
"Examples:": "Ejemplos:",
"boolean": "boolean",
"count": "cuenta",
"string": "cadena de caracteres",
"array": "tabla",
"required": "requisito",
"default:": "defecto:",
"choices:": "selección:",
"generated-value": "valor-generado",
"Not enough non-option arguments: got %s, need at least %s": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
"Too many non-option arguments: got %s, maximum of %s": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
"Missing argument value: %s": {
"one": "Falta argumento: %s",
"other": "Faltan argumentos: %s"
},
"Missing required argument: %s": {
"one": "Falta argumento requerido: %s",
"other": "Faltan argumentos requeridos: %s"
},
"Unknown argument: %s": {
"one": "Argumento desconocido: %s",
"other": "Argumentos desconocidos: %s"
},
"Invalid values:": "Valores inválidos:",
"Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Selección: %s",
"Argument check failed: %s": "Verificación de argumento ha fracasado: %s",
"Implications failed:": "Implicaciones fracasadas:",
"Not enough arguments following: %s": "No hay suficientes argumentos después de: %s",
"Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s",
"Path to JSON config file": "Ruta al archivo de configuración JSON",
"Show help": "Muestra ayuda",
"Show version number": "Muestra número de versión"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "Commandes:",
"Options:": "Options:",
"Examples:": "Exemples:",
"boolean": "booléen",
"count": "comptage",
"string": "chaine de caractère",
"array": "tableau",
"required": "requis",
"default:": "défaut:",
"choices:": "choix:",
"generated-value": "valeur générée",
"Not enough non-option arguments: got %s, need at least %s": "Pas assez d'arguments non-option: reçu %s, besoin d'au moins %s",
"Too many non-option arguments: got %s, maximum of %s": "Trop d'arguments non-option: reçu %s, maximum %s",
"Missing argument value: %s": {
"one": "Argument manquant: %s",
"other": "Arguments manquants: %s"
},
"Missing required argument: %s": {
"one": "Argument requis manquant: %s",
"other": "Arguments requis manquants: %s"
},
"Unknown argument: %s": {
"one": "Argument inconnu: %s",
"other": "Arguments inconnus: %s"
},
"Invalid values:": "Valeurs invalides:",
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s",
"Argument check failed: %s": "Echec de la vérification de l'argument: %s",
"Implications failed:": "Implications échouées:",
"Not enough arguments following: %s": "Pas assez d'arguments suivant: %s",
"Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s",
"Path to JSON config file": "Chemin du fichier de configuration JSON",
"Show help": "Affiche de l'aide",
"Show version number": "Affiche le numéro de version"
}

View File

@ -0,0 +1,37 @@
{
"Commands:": "Perintah:",
"Options:": "Pilihan:",
"Examples:": "Contoh:",
"boolean": "boolean",
"count": "jumlah",
"string": "string",
"array": "larik",
"required": "diperlukan",
"default:": "bawaan:",
"choices:": "pilihan:",
"generated-value": "nilai-yang-dihasilkan",
"Not enough non-option arguments: got %s, need at least %s": "Argumen wajib kurang: hanya %s, minimal %s",
"Too many non-option arguments: got %s, maximum of %s": "Terlalu banyak argumen wajib: ada %s, maksimal %s",
"Missing argument value: %s": {
"one": "Kurang argumen: %s",
"other": "Kurang argumen: %s"
},
"Missing required argument: %s": {
"one": "Kurang argumen wajib: %s",
"other": "Kurang argumen wajib: %s"
},
"Unknown argument: %s": {
"one": "Argumen tak diketahui: %s",
"other": "Argumen tak diketahui: %s"
},
"Invalid values:": "Nilai-nilai tidak valid:",
"Argument: %s, Given: %s, Choices: %s": "Argumen: %s, Diberikan: %s, Pilihan: %s",
"Argument check failed: %s": "Pemeriksaan argument gagal: %s",
"Implications failed:": "Implikasi gagal:",
"Not enough arguments following: %s": "Kurang argumen untuk: %s",
"Invalid JSON config file: %s": "Berkas konfigurasi JSON tidak valid: %s",
"Path to JSON config file": "Alamat berkas konfigurasi JSON",
"Show help": "Lihat bantuan",
"Show version number": "Lihat nomor versi"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "コマンド:",
"Options:": "オプション:",
"Examples:": "例:",
"boolean": "真偽",
"count": "カウント",
"string": "文字列",
"array": "配列",
"required": "必須",
"default:": "デフォルト:",
"choices:": "選択してください:",
"generated-value": "生成された値",
"Not enough non-option arguments: got %s, need at least %s": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:",
"Too many non-option arguments: got %s, maximum of %s": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:",
"Missing argument value: %s": {
"one": "引数が見つかりません: %s",
"other": "引数が見つかりません: %s"
},
"Missing required argument: %s": {
"one": "必須の引数が見つかりません: %s",
"other": "必須の引数が見つかりません: %s"
},
"Unknown argument: %s": {
"one": "未知の引数です: %s",
"other": "未知の引数です: %s"
},
"Invalid values:": "不正な値です:",
"Argument: %s, Given: %s, Choices: %s": "引数は %s です。指定できるのは %s つです。選択してください: %s",
"Argument check failed: %s": "引数のチェックに失敗しました: %s",
"Implications failed:": "オプションの組み合わせで不正が生じました:",
"Not enough arguments following: %s": "次の引数が不足しています。: %s",
"Invalid JSON config file: %s": "JSONの設定ファイルが不正です: %s",
"Path to JSON config file": "JSONの設定ファイルまでのpath",
"Show help": "ヘルプを表示",
"Show version number": "バージョンを表示"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "명령:",
"Options:": "옵션:",
"Examples:": "예시:",
"boolean": "여부",
"count": "개수",
"string": "문자열",
"array": "배열",
"required": "필수",
"default:": "기본:",
"choices:": "선택:",
"generated-value": "생성된 값",
"Not enough non-option arguments: got %s, need at least %s": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다",
"Too many non-option arguments: got %s, maximum of %s": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다",
"Missing argument value: %s": {
"one": "인자값을 받지 못했습니다: %s",
"other": "인자값들을 받지 못했습니다: %s"
},
"Missing required argument: %s": {
"one": "필수 인자를 받지 못했습니다: %s",
"other": "필수 인자들을 받지 못했습니다: %s"
},
"Unknown argument: %s": {
"one": "알 수 없는 인자입니다: %s",
"other": "알 수 없는 인자들입니다: %s"
},
"Invalid values:": "잘못된 값입니다:",
"Argument: %s, Given: %s, Choices: %s": "인자: %s, 입력받은 값: %s, 선택지: %s",
"Argument check failed: %s": "유효하지 않은 인자입니다: %s",
"Implications failed:": "옵션의 조합이 잘못되었습니다:",
"Not enough arguments following: %s": "인자가 충분하게 주어지지 않았습니다: %s",
"Invalid JSON config file: %s": "유효하지 않은 JSON 설정파일입니다: %s",
"Path to JSON config file": "JSON 설정파일 경로",
"Show help": "도움말을 보여줍니다",
"Show version number": "버전 넘버를 보여줍니다"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "Kommandoer:",
"Options:": "Alternativer:",
"Examples:": "Eksempler:",
"boolean": "boolsk",
"count": "antall",
"string": "streng",
"array": "matrise",
"required": "obligatorisk",
"default:": "standard:",
"choices:": "valg:",
"generated-value": "generert-verdi",
"Not enough non-option arguments: got %s, need at least %s": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s",
"Too many non-option arguments: got %s, maximum of %s": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s",
"Missing argument value: %s": {
"one": "Mangler argument verdi: %s",
"other": "Mangler argument verdier: %s"
},
"Missing required argument: %s": {
"one": "Mangler obligatorisk argument: %s",
"other": "Mangler obligatoriske argumenter: %s"
},
"Unknown argument: %s": {
"one": "Ukjent argument: %s",
"other": "Ukjente argumenter: %s"
},
"Invalid values:": "Ugyldige verdier:",
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s",
"Argument check failed: %s": "Argument sjekk mislyktes: %s",
"Implications failed:": "Konsekvensene mislyktes:",
"Not enough arguments following: %s": "Ikke nok følgende argumenter: %s",
"Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s",
"Path to JSON config file": "Bane til JSON konfigurasjonsfil",
"Show help": "Vis hjelp",
"Show version number": "Vis versjonsnummer"
}

View File

@ -0,0 +1,12 @@
{
"Commands:": "Choose yer command:",
"Options:": "Options for me hearties!",
"Examples:": "Ex. marks the spot:",
"required": "requi-yar-ed",
"Missing required argument: %s": {
"one": "Ye be havin' to set the followin' argument land lubber: %s",
"other": "Ye be havin' to set the followin' arguments land lubber: %s"
},
"Show help": "Parlay this here code of conduct",
"Show version number": "'Tis the version ye be askin' fer"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "Polecenia:",
"Options:": "Opcje:",
"Examples:": "Przykłady:",
"boolean": "boolean",
"count": "ilość",
"string": "ciąg znaków",
"array": "tablica",
"required": "wymagany",
"default:": "domyślny:",
"choices:": "dostępne:",
"generated-value": "wygenerowana-wartość",
"Not enough non-option arguments: got %s, need at least %s": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s",
"Too many non-option arguments: got %s, maximum of %s": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s",
"Missing argument value: %s": {
"one": "Brak wartości dla argumentu: %s",
"other": "Brak wartości dla argumentów: %s"
},
"Missing required argument: %s": {
"one": "Brak wymaganego argumentu: %s",
"other": "Brak wymaganych argumentów: %s"
},
"Unknown argument: %s": {
"one": "Nieznany argument: %s",
"other": "Nieznane argumenty: %s"
},
"Invalid values:": "Nieprawidłowe wartości:",
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Otrzymano: %s, Dostępne: %s",
"Argument check failed: %s": "Weryfikacja argumentów nie powiodła się: %s",
"Implications failed:": "Założenia nie zostały spełnione:",
"Not enough arguments following: %s": "Niewystarczająca ilość argumentów następujących po: %s",
"Invalid JSON config file: %s": "Nieprawidłowy plik konfiguracyjny JSON: %s",
"Path to JSON config file": "Ścieżka do pliku konfiguracyjnego JSON",
"Show help": "Pokaż pomoc",
"Show version number": "Pokaż numer wersji"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "Comandos:",
"Options:": "Opções:",
"Examples:": "Exemplos:",
"boolean": "boolean",
"count": "contagem",
"string": "cadeia de caracteres",
"array": "arranjo",
"required": "requerido",
"default:": "padrão:",
"choices:": "escolhas:",
"generated-value": "valor-gerado",
"Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s",
"Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos não opcionais: recebido %s, máximo de %s",
"Missing argument value: %s": {
"one": "Falta valor de argumento: %s",
"other": "Falta valores de argumento: %s"
},
"Missing required argument: %s": {
"one": "Falta argumento obrigatório: %s",
"other": "Faltando argumentos obrigatórios: %s"
},
"Unknown argument: %s": {
"one": "Argumento desconhecido: %s",
"other": "Argumentos desconhecidos: %s"
},
"Invalid values:": "Valores inválidos:",
"Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s",
"Argument check failed: %s": "Verificação de argumento falhou: %s",
"Implications failed:": "Implicações falharam:",
"Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s",
"Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s",
"Path to JSON config file": "Caminho para o arquivo de configuração em JSON",
"Show help": "Mostra ajuda",
"Show version number": "Mostra número de versão"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "Comandos:",
"Options:": "Opções:",
"Examples:": "Exemplos:",
"boolean": "boolean",
"count": "contagem",
"string": "string",
"array": "array",
"required": "obrigatório",
"default:": "padrão:",
"choices:": "opções:",
"generated-value": "valor-gerado",
"Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s",
"Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos: recebido %s, máximo de %s",
"Missing argument value: %s": {
"one": "Falta valor de argumento: %s",
"other": "Falta valores de argumento: %s"
},
"Missing required argument: %s": {
"one": "Falta argumento obrigatório: %s",
"other": "Faltando argumentos obrigatórios: %s"
},
"Unknown argument: %s": {
"one": "Argumento desconhecido: %s",
"other": "Argumentos desconhecidos: %s"
},
"Invalid values:": "Valores inválidos:",
"Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Opções: %s",
"Argument check failed: %s": "Verificação de argumento falhou: %s",
"Implications failed:": "Implicações falharam:",
"Not enough arguments following: %s": "Argumentos insuficientes a seguir: %s",
"Invalid JSON config file: %s": "Arquivo JSON de configuração inválido: %s",
"Path to JSON config file": "Caminho para o arquivo JSON de configuração",
"Show help": "Exibe ajuda",
"Show version number": "Exibe a versão"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "Komutlar:",
"Options:": "Seçenekler:",
"Examples:": "Örnekler:",
"boolean": "boolean",
"count": "sayı",
"string": "string",
"array": "array",
"required": "zorunlu",
"default:": "varsayılan:",
"choices:": "seçimler:",
"generated-value": "oluşturulan-değer",
"Not enough non-option arguments: got %s, need at least %s": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli",
"Too many non-option arguments: got %s, maximum of %s": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s",
"Missing argument value: %s": {
"one": "Eksik argüman değeri: %s",
"other": "Eksik argüman değerleri: %s"
},
"Missing required argument: %s": {
"one": "Eksik zorunlu argüman: %s",
"other": "Eksik zorunlu argümanlar: %s"
},
"Unknown argument: %s": {
"one": "Bilinmeyen argüman: %s",
"other": "Bilinmeyen argümanlar: %s"
},
"Invalid values:": "Geçersiz değerler:",
"Argument: %s, Given: %s, Choices: %s": "Argüman: %s, Verilen: %s, Seçimler: %s",
"Argument check failed: %s": "Argüman kontrolü başarısız oldu: %s",
"Implications failed:": "Sonuçlar başarısız oldu:",
"Not enough arguments following: %s": "%s için yeterli argüman bulunamadı",
"Invalid JSON config file: %s": "Geçersiz JSON yapılandırma dosyası: %s",
"Path to JSON config file": "JSON yapılandırma dosya konumu",
"Show help": "Yardım detaylarını göster",
"Show version number": "Versiyon detaylarını göster"
}

View File

@ -0,0 +1,36 @@
{
"Commands:": "命令:",
"Options:": "选项:",
"Examples:": "示例:",
"boolean": "boolean",
"count": "count",
"string": "string",
"array": "array",
"required": "required",
"default:": "默认值:",
"choices:": "可选值:",
"generated-value": "生成的值",
"Not enough non-option arguments: got %s, need at least %s": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个",
"Too many non-option arguments: got %s, maximum of %s": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个",
"Missing argument value: %s": {
"one": "没有给此选项指定值:%s",
"other": "没有给这些选项指定值:%s"
},
"Missing required argument: %s": {
"one": "缺少必须的选项:%s",
"other": "缺少这些必须的选项:%s"
},
"Unknown argument: %s": {
"one": "无法识别的选项:%s",
"other": "无法识别这些选项:%s"
},
"Invalid values:": "无效的选项值:",
"Argument: %s, Given: %s, Choices: %s": "选项名称: %s, 传入的值: %s, 可选的值:%s",
"Argument check failed: %s": "选项值验证失败:%s",
"Implications failed:": "缺少依赖的选项:",
"Not enough arguments following: %s": "没有提供足够的值给此选项:%s",
"Invalid JSON config file: %s": "无效的 JSON 配置文件:%s",
"Path to JSON config file": "JSON 配置文件的路径",
"Show help": "显示帮助信息",
"Show version number": "显示版本号"
}

134
node_modules/nunjucks/node_modules/yargs/package.json generated vendored Normal file
View File

@ -0,0 +1,134 @@
{
"_args": [
[
"yargs@3.32.0",
"/Users/tatiana/selfdefined"
]
],
"_from": "yargs@3.32.0",
"_id": "yargs@3.32.0",
"_inBundle": false,
"_integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=",
"_location": "/nunjucks/yargs",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "yargs@3.32.0",
"name": "yargs",
"escapedName": "yargs",
"rawSpec": "3.32.0",
"saveSpec": null,
"fetchSpec": "3.32.0"
},
"_requiredBy": [
"/nunjucks"
],
"_resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz",
"_spec": "3.32.0",
"_where": "/Users/tatiana/selfdefined",
"author": {
"name": "Alex Ford",
"email": "Alex.Ford@CodeTunnel.com",
"url": "http://CodeTunnel.com"
},
"bugs": {
"url": "https://github.com/bcoe/yargs/issues"
},
"contributors": [
{
"name": "Benjamin Coe",
"email": "ben@npmjs.com",
"url": "https://github.com/bcoe"
},
{
"name": "Andrew Goode",
"url": "https://github.com/nexdrew"
},
{
"name": "Chris Needham",
"email": "chris@chrisneedham.com",
"url": "http://chrisneedham.com"
},
{
"name": "James Nylen",
"email": "jnylen@gmail.com",
"url": "https://github.com/nylen"
},
{
"name": "Benjamin Horsleben",
"url": "https://github.com/fizker"
},
{
"name": "Lin Clark",
"url": "https://github.com/linclark"
},
{
"name": "Tim Schaub",
"url": "https://github.com/tschaub"
}
],
"dependencies": {
"camelcase": "^2.0.1",
"cliui": "^3.0.3",
"decamelize": "^1.1.1",
"os-locale": "^1.4.0",
"string-width": "^1.0.1",
"window-size": "^0.1.4",
"y18n": "^3.2.0"
},
"description": "Light-weight option parsing with an argv hash. No optstrings attached.",
"devDependencies": {
"chai": "^3.4.1",
"chalk": "^1.1.1",
"coveralls": "^2.11.4",
"es6-promise": "^3.0.2",
"hashish": "0.0.4",
"mocha": "^2.3.4",
"nyc": "^5.2.0",
"standard": "^5.4.1",
"which": "^1.1.2",
"win-spawn": "^2.0.0"
},
"engine": {
"node": ">=0.10"
},
"files": [
"index.js",
"lib",
"locales",
"completion.sh.hbs",
"LICENSE"
],
"homepage": "https://github.com/bcoe/yargs#readme",
"keywords": [
"argument",
"args",
"option",
"parser",
"parsing",
"cli",
"command"
],
"license": "MIT",
"main": "./index.js",
"name": "yargs",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/bcoe/yargs.git"
},
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
"pretest": "standard",
"test": "nyc --cache mocha --timeout=4000 --check-leaks"
},
"standard": {
"ignore": [
"**/example/**"
],
"globals": [
"it"
]
},
"version": "3.32.0"
}