pax_global_header00006660000000000000000000000064134510002740014506gustar00rootroot0000000000000052 comment=3e8bf54b9b2fb3960fc2320a4174aa79efca90fa commander.js-2.20.0/000077500000000000000000000000001345100027400141475ustar00rootroot00000000000000commander.js-2.20.0/.eslintrc.json000066400000000000000000000002331345100027400167410ustar00rootroot00000000000000{ "extends": "standard", "rules": { "one-var": "off", "semi": ["error", "always"], "space-before-function-paren": ["error", "never"] } } commander.js-2.20.0/.gitignore000066400000000000000000000000551345100027400161370ustar00rootroot00000000000000.DS_Store node_modules *.sock .idea .vscode/ commander.js-2.20.0/.travis.yml000066400000000000000000000002071345100027400162570ustar00rootroot00000000000000language: node_js sudo: false node_js: - "6" - "8" - "10" cache: directories: - "node_modules" script: - npm run lint - npm test commander.js-2.20.0/CHANGELOG.md000066400000000000000000000255161345100027400157710ustar00rootroot00000000000000 2.20.0 / 2019-04-02 ================== * fix: resolve symbolic links completely when hunting for subcommands (#935) * Update index.d.ts (#930) * Update Readme.md (#924) * Remove --save option as it isn't required anymore (#918) * Add link to the license file (#900) * Added example of receiving args from options (#858) * Added missing semicolon (#882) * Add extension to .eslintrc (#876) 2.19.0 / 2018-10-02 ================== * Removed newline after Options and Commands headers (#864) * Bugfix - Error output (#862) * Fix to change default value to string (#856) 2.18.0 / 2018-09-07 ================== * Standardize help output (#853) * chmod 644 travis.yml (#851) * add support for execute typescript subcommand via ts-node (#849) 2.17.1 / 2018-08-07 ================== * Fix bug in command emit (#844) 2.17.0 / 2018-08-03 ================== * fixed newline output after help information (#833) * Fix to emit the action even without command (#778) * npm update (#823) 2.16.0 / 2018-06-29 ================== * Remove Makefile and `test/run` (#821) * Make 'npm test' run on Windows (#820) * Add badge to display install size (#807) * chore: cache node_modules (#814) * chore: remove Node.js 4 (EOL), add Node.js 10 (#813) * fixed typo in readme (#812) * Fix types (#804) * Update eslint to resolve vulnerabilities in lodash (#799) * updated readme with custom event listeners. (#791) * fix tests (#794) 2.15.0 / 2018-03-07 ================== * Update downloads badge to point to graph of downloads over time instead of duplicating link to npm * Arguments description 2.14.1 / 2018-02-07 ================== * Fix typing of help function 2.14.0 / 2018-02-05 ================== * only register the option:version event once * Fixes issue #727: Passing empty string for option on command is set to undefined * enable eqeqeq rule * resolves #754 add linter configuration to project * resolves #560 respect custom name for version option * document how to override the version flag * document using options per command 2.13.0 / 2018-01-09 ================== * Do not print default for --no- * remove trailing spaces in command help * Update CI's Node.js to LTS and latest version * typedefs: Command and Option types added to commander namespace 2.12.2 / 2017-11-28 ================== * fix: typings are not shipped 2.12.1 / 2017-11-23 ================== * Move @types/node to dev dependency 2.12.0 / 2017-11-22 ================== * add attributeName() method to Option objects * Documentation updated for options with --no prefix * typings: `outputHelp` takes a string as the first parameter * typings: use overloads * feat(typings): update to match js api * Print default value in option help * Fix translation error * Fail when using same command and alias (#491) * feat(typings): add help callback * fix bug when description is add after command with options (#662) * Format js code * Rename History.md to CHANGELOG.md (#668) * feat(typings): add typings to support TypeScript (#646) * use current node 2.11.0 / 2017-07-03 ================== * Fix help section order and padding (#652) * feature: support for signals to subcommands (#632) * Fixed #37, --help should not display first (#447) * Fix translation errors. (#570) * Add package-lock.json * Remove engines * Upgrade package version * Prefix events to prevent conflicts between commands and options (#494) * Removing dependency on graceful-readlink * Support setting name in #name function and make it chainable * Add .vscode directory to .gitignore (Visual Studio Code metadata) * Updated link to ruby commander in readme files 2.10.0 / 2017-06-19 ================== * Update .travis.yml. drop support for older node.js versions. * Fix require arguments in README.md * On SemVer you do not start from 0.0.1 * Add missing semi colon in readme * Add save param to npm install * node v6 travis test * Update Readme_zh-CN.md * Allow literal '--' to be passed-through as an argument * Test subcommand alias help * link build badge to master branch * Support the alias of Git style sub-command * added keyword commander for better search result on npm * Fix Sub-Subcommands * test node.js stable * Fixes TypeError when a command has an option called `--description` * Update README.md to make it beginner friendly and elaborate on the difference between angled and square brackets. * Add chinese Readme file 2.9.0 / 2015-10-13 ================== * Add option `isDefault` to set default subcommand #415 @Qix- * Add callback to allow filtering or post-processing of help text #434 @djulien * Fix `undefined` text in help information close #414 #416 @zhiyelee 2.8.1 / 2015-04-22 ================== * Back out `support multiline description` Close #396 #397 2.8.0 / 2015-04-07 ================== * Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee * Fix bug in Git-style sub-commands #372 @zhiyelee * Allow commands to be hidden from help #383 @tonylukasavage * When git-style sub-commands are in use, yet none are called, display help #382 @claylo * Add ability to specify arguments syntax for top-level command #258 @rrthomas * Support multiline descriptions #208 @zxqfox 2.7.1 / 2015-03-11 ================== * Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367. 2.7.0 / 2015-03-09 ================== * Fix git-style bug when installed globally. Close #335 #349 @zhiyelee * Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage * Add support for camelCase on `opts()`. Close #353 @nkzawa * Add node.js 0.12 and io.js to travis.yml * Allow RegEx options. #337 @palanik * Fixes exit code when sub-command failing. Close #260 #332 @pirelenito * git-style `bin` files in $PATH make sense. Close #196 #327 @zhiyelee 2.6.0 / 2014-12-30 ================== * added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee * Add application description to the help msg. Close #112 @dalssoft 2.5.1 / 2014-12-15 ================== * fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee 2.5.0 / 2014-10-24 ================== * add support for variadic arguments. Closes #277 @whitlockjc 2.4.0 / 2014-10-17 ================== * fixed a bug on executing the coercion function of subcommands option. Closes #270 * added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage * added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage * fixed a bug on subcommand name. Closes #248 @jonathandelgado * fixed function normalize doesn’t honor option terminator. Closes #216 @abbr 2.3.0 / 2014-07-16 ================== * add command alias'. Closes PR #210 * fix: Typos. Closes #99 * fix: Unused fs module. Closes #217 2.2.0 / 2014-03-29 ================== * add passing of previous option value * fix: support subcommands on windows. Closes #142 * Now the defaultValue passed as the second argument of the coercion function. 2.1.0 / 2013-11-21 ================== * add: allow cflag style option params, unit test, fixes #174 2.0.0 / 2013-07-18 ================== * remove input methods (.prompt, .confirm, etc) 1.3.2 / 2013-07-18 ================== * add support for sub-commands to co-exist with the original command 1.3.1 / 2013-07-18 ================== * add quick .runningCommand hack so you can opt-out of other logic when running a sub command 1.3.0 / 2013-07-09 ================== * add EACCES error handling * fix sub-command --help 1.2.0 / 2013-06-13 ================== * allow "-" hyphen as an option argument * support for RegExp coercion 1.1.1 / 2012-11-20 ================== * add more sub-command padding * fix .usage() when args are present. Closes #106 1.1.0 / 2012-11-16 ================== * add git-style executable subcommand support. Closes #94 1.0.5 / 2012-10-09 ================== * fix `--name` clobbering. Closes #92 * fix examples/help. Closes #89 1.0.4 / 2012-09-03 ================== * add `outputHelp()` method. 1.0.3 / 2012-08-30 ================== * remove invalid .version() defaulting 1.0.2 / 2012-08-24 ================== * add `--foo=bar` support [arv] * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus] 1.0.1 / 2012-08-03 ================== * fix issue #56 * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode()) 1.0.0 / 2012-07-05 ================== * add support for optional option descriptions * add defaulting of `.version()` to package.json's version 0.6.1 / 2012-06-01 ================== * Added: append (yes or no) on confirmation * Added: allow node.js v0.7.x 0.6.0 / 2012-04-10 ================== * Added `.prompt(obj, callback)` support. Closes #49 * Added default support to .choose(). Closes #41 * Fixed the choice example 0.5.1 / 2011-12-20 ================== * Fixed `password()` for recent nodes. Closes #36 0.5.0 / 2011-12-04 ================== * Added sub-command option support [itay] 0.4.3 / 2011-12-04 ================== * Fixed custom help ordering. Closes #32 0.4.2 / 2011-11-24 ================== * Added travis support * Fixed: line-buffered input automatically trimmed. Closes #31 0.4.1 / 2011-11-18 ================== * Removed listening for "close" on --help 0.4.0 / 2011-11-15 ================== * Added support for `--`. Closes #24 0.3.3 / 2011-11-14 ================== * Fixed: wait for close event when writing help info [Jerry Hamlet] 0.3.2 / 2011-11-01 ================== * Fixed long flag definitions with values [felixge] 0.3.1 / 2011-10-31 ================== * Changed `--version` short flag to `-V` from `-v` * Changed `.version()` so it's configurable [felixge] 0.3.0 / 2011-10-31 ================== * Added support for long flags only. Closes #18 0.2.1 / 2011-10-24 ================== * "node": ">= 0.4.x < 0.7.0". Closes #20 0.2.0 / 2011-09-26 ================== * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] 0.1.0 / 2011-08-24 ================== * Added support for custom `--help` output 0.0.5 / 2011-08-18 ================== * Changed: when the user enters nothing prompt for password again * Fixed issue with passwords beginning with numbers [NuckChorris] 0.0.4 / 2011-08-15 ================== * Fixed `Commander#args` 0.0.3 / 2011-08-15 ================== * Added default option value support 0.0.2 / 2011-08-15 ================== * Added mask support to `Command#password(str[, mask], fn)` * Added `Command#password(str, fn)` 0.0.1 / 2010-01-03 ================== * Initial release commander.js-2.20.0/LICENSE000066400000000000000000000021121345100027400151500ustar00rootroot00000000000000(The MIT License) Copyright (c) 2011 TJ Holowaychuk 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. commander.js-2.20.0/Readme.md000066400000000000000000000307571345100027400157020ustar00rootroot00000000000000# Commander.js [![Build Status](https://api.travis-ci.org/tj/commander.js.svg?branch=master)](http://travis-ci.org/tj/commander.js) [![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) [![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true) [![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=commander) [![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander). [API documentation](http://tj.github.com/commander.js/) ## Installation $ npm install commander ## Option parsing Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.1.0') .option('-p, --peppers', 'Add peppers') .option('-P, --pineapple', 'Add pineapple') .option('-b, --bbq-sauce', 'Add bbq sauce') .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') .parse(process.argv); console.log('you ordered a pizza with:'); if (program.peppers) console.log(' - peppers'); if (program.pineapple) console.log(' - pineapple'); if (program.bbqSauce) console.log(' - bbq'); console.log(' - %s cheese', program.cheese); ``` Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false. ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .option('--no-sauce', 'Remove sauce') .parse(process.argv); console.log('you ordered a pizza'); if (program.sauce) console.log(' with sauce'); else console.log(' without sauce'); ``` To get string arguments from options you will need to use angle brackets <> for required inputs or square brackets [] for optional inputs. e.g. ```.option('-m --myarg [myVar]', 'my super cool description')``` Then to access the input if it was passed in. e.g. ```var myInput = program.myarg``` **NOTE**: If you pass a argument without using brackets the example above will return true and not the value passed in. ## Version option Calling the `version` implicitly adds the `-V` and `--version` options to the command. When either of these options is present, the command prints the version number and exits. $ ./examples/pizza -V 0.0.1 If you want your program to respond to the `-v` option instead of the `-V` option, simply pass custom flags to the `version` method using the same syntax as the `option` method. ```js program .version('0.0.1', '-v, --version') ``` The version flags can be named anything, but the long option is required. ## Command-specific options You can attach options to a command. ```js #!/usr/bin/env node var program = require('commander'); program .command('rm ') .option('-r, --recursive', 'Remove recursively') .action(function (dir, cmd) { console.log('remove ' + dir + (cmd.recursive ? ' recursively' : '')) }) program.parse(process.argv) ``` A command's options are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated. ## Coercion ```js function range(val) { return val.split('..').map(Number); } function list(val) { return val.split(','); } function collect(val, memo) { memo.push(val); return memo; } function increaseVerbosity(v, total) { return total + 1; } program .version('0.1.0') .usage('[options] ') .option('-i, --integer ', 'An integer argument', parseInt) .option('-f, --float ', 'A float argument', parseFloat) .option('-r, --range ..', 'A range', range) .option('-l, --list ', 'A list', list) .option('-o, --optional [value]', 'An optional value') .option('-c, --collect [value]', 'A repeatable value', collect, []) .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0) .parse(process.argv); console.log(' int: %j', program.integer); console.log(' float: %j', program.float); console.log(' optional: %j', program.optional); program.range = program.range || []; console.log(' range: %j..%j', program.range[0], program.range[1]); console.log(' list: %j', program.list); console.log(' collect: %j', program.collect); console.log(' verbosity: %j', program.verbose); console.log(' args: %j', program.args); ``` ## Regular Expression ```js program .version('0.1.0') .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium') .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i) .parse(process.argv); console.log(' size: %j', program.size); console.log(' drink: %j', program.drink); ``` ## Variadic arguments The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to append `...` to the argument name. Here is an example: ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.1.0') .command('rmdir [otherDirs...]') .action(function (dir, otherDirs) { console.log('rmdir %s', dir); if (otherDirs) { otherDirs.forEach(function (oDir) { console.log('rmdir %s', oDir); }); } }); program.parse(process.argv); ``` An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed to your action as demonstrated above. ## Specify the argument syntax ```js #!/usr/bin/env node var program = require('commander'); program .version('0.1.0') .arguments(' [env]') .action(function (cmd, env) { cmdValue = cmd; envValue = env; }); program.parse(process.argv); if (typeof cmdValue === 'undefined') { console.error('no command given!'); process.exit(1); } console.log('command:', cmdValue); console.log('environment:', envValue || "no environment given"); ``` Angled brackets (e.g. ``) indicate required input. Square brackets (e.g. `[env]`) indicate optional input. ## Git-style sub-commands ```js // file: ./examples/pm var program = require('commander'); program .version('0.1.0') .command('install [name]', 'install one or more packages') .command('search [query]', 'search with optional query') .command('list', 'list packages installed', {isDefault: true}) .parse(process.argv); ``` When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`. Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the subcommand from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified. If the program is designed to be installed globally, make sure the executables have proper modes, like `755`. ### `--harmony` You can enable `--harmony` option in two ways: * Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern. * Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process. ## Automated --help The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: ``` $ ./examples/pizza --help Usage: pizza [options] An application for pizzas ordering Options: -h, --help output usage information -V, --version output the version number -p, --peppers Add peppers -P, --pineapple Add pineapple -b, --bbq Add bbq sauce -c, --cheese Add the specified type of cheese [marble] -C, --no-cheese You do not want any cheese ``` ## Custom help You can display arbitrary `-h, --help` information by listening for "--help". Commander will automatically exit once you are done so that the remainder of your program does not execute causing undesired behaviors, for example in the following executable "stuff" will not output when `--help` is used. ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.1.0') .option('-f, --foo', 'enable some foo') .option('-b, --bar', 'enable some bar') .option('-B, --baz', 'enable some baz'); // must be before .parse() since // node's emit() is immediate program.on('--help', function(){ console.log('') console.log('Examples:'); console.log(' $ custom-help --help'); console.log(' $ custom-help -h'); }); program.parse(process.argv); console.log('stuff'); ``` Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run: ``` Usage: custom-help [options] Options: -h, --help output usage information -V, --version output the version number -f, --foo enable some foo -b, --bar enable some bar -B, --baz enable some baz Examples: $ custom-help --help $ custom-help -h ``` ## .outputHelp(cb) Output help information without exiting. Optional callback cb allows post-processing of help text before it is displayed. If you want to display help by default (e.g. if no command was provided), you can use something like: ```js var program = require('commander'); var colors = require('colors'); program .version('0.1.0') .command('getstream [url]', 'get stream URL') .parse(process.argv); if (!process.argv.slice(2).length) { program.outputHelp(make_red); } function make_red(txt) { return colors.red(txt); //display the help text in red on the console } ``` ## .help(cb) Output help information and exit immediately. Optional callback cb allows post-processing of help text before it is displayed. ## Custom event listeners You can execute custom actions by listening to command and option events. ```js program.on('option:verbose', function () { process.env.VERBOSE = this.verbose; }); // error on unknown commands program.on('command:*', function () { console.error('Invalid command: %s\nSee --help for a list of available commands.', program.args.join(' ')); process.exit(1); }); ``` ## Examples ```js var program = require('commander'); program .version('0.1.0') .option('-C, --chdir ', 'change the working directory') .option('-c, --config ', 'set config path. defaults to ./deploy.conf') .option('-T, --no-tests', 'ignore test hook'); program .command('setup [env]') .description('run setup commands for all envs') .option("-s, --setup_mode [mode]", "Which setup mode to use") .action(function(env, options){ var mode = options.setup_mode || "normal"; env = env || 'all'; console.log('setup for %s env(s) with %s mode', env, mode); }); program .command('exec ') .alias('ex') .description('execute the given remote cmd') .option("-e, --exec_mode ", "Which exec mode to use") .action(function(cmd, options){ console.log('exec "%s" using %s mode', cmd, options.exec_mode); }).on('--help', function() { console.log(''); console.log('Examples:'); console.log(''); console.log(' $ deploy exec sequential'); console.log(' $ deploy exec async'); }); program .command('*') .action(function(env){ console.log('deploying "%s"', env); }); program.parse(process.argv); ``` More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory. ## License [MIT](https://github.com/tj/commander.js/blob/master/LICENSE) commander.js-2.20.0/Readme_zh-CN.md000066400000000000000000000230711345100027400166700ustar00rootroot00000000000000# Commander.js [![Build Status](https://api.travis-ci.org/tj/commander.js.svg)](http://travis-ci.org/tj/commander.js) [![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) [![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander) [![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [node.js](http://nodejs.org) 命令行接口的完整解决方案,灵感来自 Ruby 的 [commander](https://github.com/commander-rb/commander)。 [API 文档](http://tj.github.com/commander.js/) ## 安装 $ npm install commander ## 参数解析 `.option()` 方法用来定义带选项的 commander,同时也作为这些选项的文档。下面的例子会解析来自 `process.argv` 指定的参数和选项,没有匹配任何选项的参数将会放到 `program.args` 数组中。 ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.0.1') .option('-p, --peppers', 'Add peppers') .option('-P, --pineapple', 'Add pineapple') .option('-b, --bbq-sauce', 'Add bbq sauce') .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') .parse(process.argv); console.log('you ordered a pizza with:'); if (program.peppers) console.log(' - peppers'); if (program.pineapple) console.log(' - pineapple'); if (program.bbqSauce) console.log(' - bbq'); console.log(' - %s cheese', program.cheese); ``` 短标志可以作为单独的参数传递。像 `-abc` 等于 `-a -b -c`。多词组成的选项,像“--template-engine”会变成 `program.templateEngine` 等。 ## 强制多态 ```js function range(val) { return val.split('..').map(Number); } function list(val) { return val.split(','); } function collect(val, memo) { memo.push(val); return memo; } function increaseVerbosity(v, total) { return total + 1; } program .version('0.0.1') .usage('[options] ') .option('-i, --integer ', 'An integer argument', parseInt) .option('-f, --float ', 'A float argument', parseFloat) .option('-r, --range ..', 'A range', range) .option('-l, --list ', 'A list', list) .option('-o, --optional [value]', 'An optional value') .option('-c, --collect [value]', 'A repeatable value', collect, []) .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0) .parse(process.argv); console.log(' int: %j', program.integer); console.log(' float: %j', program.float); console.log(' optional: %j', program.optional); program.range = program.range || []; console.log(' range: %j..%j', program.range[0], program.range[1]); console.log(' list: %j', program.list); console.log(' collect: %j', program.collect); console.log(' verbosity: %j', program.verbose); console.log(' args: %j', program.args); ``` ## 正则表达式 ```js program .version('0.0.1') .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium') .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i) .parse(process.argv); console.log(' size: %j', program.size); console.log(' drink: %j', program.drink); ``` ## 可变参数 一个命令的最后一个参数可以是可变参数, 并且只有最后一个参数可变。为了使参数可变,你需要在参数名后面追加 `...`。 下面是个示例: ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.0.1') .command('rmdir [otherDirs...]') .action(function (dir, otherDirs) { console.log('rmdir %s', dir); if (otherDirs) { otherDirs.forEach(function (oDir) { console.log('rmdir %s', oDir); }); } }); program.parse(process.argv); ``` 可变参数的值以 `数组` 的形式保存。如上所示,在传递给你的 action 的参数和 `program.args` 中的值都是如此。 ## 指定参数的语法 ```js #!/usr/bin/env node var program = require('../'); program .version('0.0.1') .arguments(' [env]') .action(function (cmd, env) { cmdValue = cmd; envValue = env; }); program.parse(process.argv); if (typeof cmdValue === 'undefined') { console.error('no command given!'); process.exit(1); } console.log('command:', cmdValue); console.log('environment:', envValue || "no environment given"); ``` 尖括号(例如 ``)代表必填输入,方括号(例如 `[env]`)代表可选输入。 ## Git 风格的子命令 ```js // file: ./examples/pm var program = require('..'); program .version('0.0.1') .command('install [name]', 'install one or more packages') .command('search [query]', 'search with optional query') .command('list', 'list packages installed', {isDefault: true}) .parse(process.argv); ``` 当 `.command()` 带有描述参数时,不能采用 `.action(callback)` 来处理子命令,否则会出错。这告诉 commander,你将采用单独的可执行文件作为子命令,就像 `git(1)` 和其他流行的工具一样。 Commander 将会尝试在入口脚本(例如 `./examples/pm`)的目录中搜索 `program-command` 形式的可执行文件,例如 `pm-install`, `pm-search`。 你可以在调用 `.command()` 时传递选项。指定 `opts.noHelp` 为 `true` 将从生成的帮助输出中剔除该选项。指定 `opts.isDefault` 为 `true` 将会在没有其它子命令指定的情况下,执行该子命令。 如果你打算全局安装该命令,请确保可执行文件有对应的权限,例如 `755`。 ### `--harmony` 您可以采用两种方式启用 `--harmony`: * 在子命令脚本中加上 `#!/usr/bin/env node --harmony`。注意一些系统版本不支持此模式。 * 在指令调用时加上 `--harmony` 参数,例如 `node --harmony examples/pm publish`。`--harmony` 选项在开启子进程时会被保留。 ## 自动化帮助信息 --help 帮助信息是 commander 基于你的程序自动生成的,下面是 `--help` 生成的帮助信息: ``` $ ./examples/pizza --help Usage: pizza [options] An application for pizzas ordering Options: -h, --help output usage information -V, --version output the version number -p, --peppers Add peppers -P, --pineapple Add pineapple -b, --bbq Add bbq sauce -c, --cheese Add the specified type of cheese [marble] -C, --no-cheese You do not want any cheese ``` ## 自定义帮助 你可以通过监听 `--help` 来控制 `-h, --help` 显示任何信息。一旦调用完成, Commander 将自动退出,你的程序的其余部分不会展示。例如在下面的 “stuff” 将不会在执行 `--help` 时输出。 ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.0.1') .option('-f, --foo', 'enable some foo') .option('-b, --bar', 'enable some bar') .option('-B, --baz', 'enable some baz'); // must be before .parse() since // node's emit() is immediate program.on('--help', function(){ console.log(''); console.log('Examples:'); console.log(' $ custom-help --help'); console.log(' $ custom-help -h'); }); program.parse(process.argv); console.log('stuff'); ``` 下列帮助信息是运行 `node script-name.js -h` or `node script-name.js --help` 时输出的: ``` Usage: custom-help [options] Options: -h, --help output usage information -V, --version output the version number -f, --foo enable some foo -b, --bar enable some bar -B, --baz enable some baz Examples: $ custom-help --help $ custom-help -h ``` ## .outputHelp(cb) 不退出输出帮助信息。 可选的回调可在显示帮助文本后处理。 如果你想显示默认的帮助(例如,如果没有提供命令),你可以使用类似的东西: ```js var program = require('commander'); var colors = require('colors'); program .version('0.0.1') .command('getstream [url]', 'get stream URL') .parse(process.argv); if (!process.argv.slice(2).length) { program.outputHelp(make_red); } function make_red(txt) { return colors.red(txt); // 在控制台上显示红色的帮助文本 } ``` ## .help(cb) 输出帮助信息并立即退出。 可选的回调可在显示帮助文本后处理。 ## 例子 ```js var program = require('commander'); program .version('0.0.1') .option('-C, --chdir ', 'change the working directory') .option('-c, --config ', 'set config path. defaults to ./deploy.conf') .option('-T, --no-tests', 'ignore test hook') program .command('setup [env]') .description('run setup commands for all envs') .option("-s, --setup_mode [mode]", "Which setup mode to use") .action(function(env, options){ var mode = options.setup_mode || "normal"; env = env || 'all'; console.log('setup for %s env(s) with %s mode', env, mode); }); program .command('exec ') .alias('ex') .description('execute the given remote cmd') .option("-e, --exec_mode ", "Which exec mode to use") .action(function(cmd, options){ console.log('exec "%s" using %s mode', cmd, options.exec_mode); }).on('--help', function() { console.log(''); console.log('Examples:'); console.log(''); console.log(' $ deploy exec sequential'); console.log(' $ deploy exec async'); }); program .command('*') .action(function(env){ console.log('deploying "%s"', env); }); program.parse(process.argv); ``` 更多的 [演示](https://github.com/tj/commander.js/tree/master/examples) 可以在这里找到. ## 许可证 MIT commander.js-2.20.0/examples/000077500000000000000000000000001345100027400157655ustar00rootroot00000000000000commander.js-2.20.0/examples/coercion000077500000000000000000000023271345100027400175200ustar00rootroot00000000000000#!/usr/bin/env node /** * Module dependencies. */ var program = require('../'); function range(val) { return val.split('..').map(Number); } function list(val) { return val.split(','); } function collect(val, memo) { memo.push(val); return memo; } function increaseVerbosity(v, total) { return total + 1; } program .version('0.0.1') .usage('test') .option('-i, --integer ', 'An integer argument', parseInt) .option('-f, --float ', 'A float argument', parseFloat) .option('-r, --range ..', 'A range', range) .option('-l, --list ', 'A list', list) .option('-o, --optional [value]', 'An optional value') .option('-c, --collect [value]', 'A repeatable value', collect, []) .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0) .parse(process.argv); console.log(' int: %j', program.integer); console.log(' float: %j', program.float); console.log(' optional: %j', program.optional); program.range = program.range || []; console.log(' range: %j..%j', program.range[0], program.range[1]); console.log(' list: %j', program.list); console.log(' collect: %j', program.collect); console.log(' verbosity: %j', program.verbose); console.log(' args: %j', program.args); commander.js-2.20.0/examples/custom-help000077500000000000000000000010251345100027400201510ustar00rootroot00000000000000#!/usr/bin/env node /** * Module dependencies. */ var program = require('../'); program .version('0.0.1') .option('-f, --foo', 'enable some foo') .option('-b, --bar', 'enable some bar') .option('-B, --baz', 'enable some baz'); // must be before .parse() since // node's emit() is immediate program.on('--help', function(){ console.log(''); console.log('Examples:'); console.log(''); console.log(' $ custom-help --help'); console.log(' $ custom-help -h'); }); program.parse(process.argv); program.help(); commander.js-2.20.0/examples/defaults000077500000000000000000000011371345100027400175240ustar00rootroot00000000000000#!/usr/bin/env node /** * Module dependencies. */ var program = require('../'); function list(val) { return val.split(',').map(Number); } program .version('0.0.1') .option('-t, --template-engine [engine]', 'Add template [engine] support', 'jade') .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') .option('-l, --list [items]', 'Specify list items defaulting to 1,2,3', list, [1,2,3]) .parse(process.argv); console.log(' - %s template engine', program.templateEngine); console.log(' - %s cheese', program.cheese); console.log(' - %j', program.list); commander.js-2.20.0/examples/deploy000077500000000000000000000022761345100027400172160ustar00rootroot00000000000000#!/usr/bin/env node /** * Module dependencies. */ var program = require('../'); program .version('0.0.1') .option('-C, --chdir ', 'change the working directory') .option('-c, --config ', 'set config path. defaults to ./deploy.conf') .option('-T, --no-tests', 'ignore test hook') program .command('setup [env]') .description('run setup commands for all envs') .option("-s, --setup_mode [mode]", "Which setup mode to use") .action(function(env, options){ var mode = options.setup_mode || "normal"; env = env || 'all'; console.log('setup for %s env(s) with %s mode', env, mode); }); program .command('exec ') .alias('ex') .description('execute the given remote cmd') .option("-e, --exec_mode ", "Which exec mode to use") .action(function(cmd, options){ console.log('exec "%s" using %s mode', cmd, options.exec_mode); }).on('--help', function() { console.log(' Examples:'); console.log(); console.log(' $ deploy exec sequential'); console.log(' $ deploy exec async'); console.log(); }); program .command('*') .action(function(env){ console.log('deploying "%s"', env); }); program.parse(process.argv); commander.js-2.20.0/examples/description000077500000000000000000000005441345100027400202410ustar00rootroot00000000000000#!/usr/bin/env node /** * Module dependencies. */ var program = require('../'); program .version('0.0.1') .description('Application simple description') .option('-f, --foo', 'enable some foo') .option('-b, --bar', 'enable some bar') .option('-B, --baz', 'enable some baz') .parse(process.argv); if (!program.args.length) program.help(); commander.js-2.20.0/examples/env000077500000000000000000000006431345100027400165060ustar00rootroot00000000000000#!/usr/bin/env node var program = require('../'); program .version('0.0.1') .arguments(' [env]') .action(function (cmd, env) { cmdValue = cmd; envValue = env; }); program.parse(process.argv); if (typeof cmdValue === 'undefined') { console.error('no command given!'); process.exit(1); } console.log('command:', cmdValue); console.log('environment:', envValue || "no environment given"); commander.js-2.20.0/examples/express000077500000000000000000000007741345100027400174140ustar00rootroot00000000000000#!/usr/bin/env node /** * Module dependencies. */ var program = require('../'); program .version('0.0.1') .option('-s, --sessions', 'add session support') .option('-t, --template ', 'specify template engine (jade|ejs) [jade]', 'jade') .option('-c, --css ', 'specify stylesheet engine (stylus|sass|less) [css]', 'css') .parse(process.argv); console.log(' - sessions %j', program.sessions); console.log(' - template %j', program.template); console.log(' - css %j', program.css);commander.js-2.20.0/examples/help000077500000000000000000000004631345100027400166460ustar00rootroot00000000000000#!/usr/bin/env node /** * Module dependencies. */ var program = require('../'); program .version('0.0.1') .option('-f, --foo', 'enable some foo') .option('-b, --bar', 'enable some bar') .option('-B, --baz', 'enable some baz') .parse(process.argv); if (!program.args.length) program.help(); commander.js-2.20.0/examples/pizza000077500000000000000000000014221345100027400170470ustar00rootroot00000000000000#!/usr/bin/env node /** * Module dependencies. */ var program = require('../'); program .version('0.0.1') .description('An application for pizzas ordering') .option('-p, --peppers', 'Add peppers') .option('-P, --pineapple', 'Add pineapple') .option('-b, --bbq', 'Add bbq sauce') .option('-c, --cheese ', 'Add the specified type of cheese [marble]') .option('-C, --no-cheese', 'You do not want any cheese') .parse(process.argv); console.log('you ordered a pizza with:'); if (program.peppers) console.log(' - peppers'); if (program.pineapple) console.log(' - pineapple'); if (program.bbq) console.log(' - bbq'); var cheese = true === program.cheese ? 'marble' : program.cheese || 'no'; console.log(' - %s cheese', cheese); console.log(program.args); commander.js-2.20.0/examples/pm000077500000000000000000000016441345100027400163340ustar00rootroot00000000000000#!/usr/bin/env node var program = require('..'); program .version('0.0.1') .description('Fake package manager') .command('install [name]', 'install one or more packages').alias('i') .command('search [query]', 'search with optional query').alias('s') .command('list', 'list packages installed') .command('publish', 'publish the package').alias('p') .parse(process.argv); // here .command() is invoked with a description, // and no .action(callback) calls to handle sub-commands. // this tells commander that you're going to use separate // executables for sub-commands, much like git(1) and other // popular tools. // here only ./pm-install(1) is implemented, however you // would define ./pm-search(1) and ./pm-list(1) etc. // Try the following: // ./examples/pm // ./examples/pm help install // ./examples/pm install -h // ./examples/pm install foo bar baz // ./examples/pm install foo bar baz --force commander.js-2.20.0/examples/pm-install000077500000000000000000000006051345100027400177740ustar00rootroot00000000000000#!/usr/bin/env node var program = require('..'); program .option('-f, --force', 'force installation') .parse(process.argv); var pkgs = program.args; if (!pkgs.length) { console.error('packages required'); process.exit(1); } console.log(); if (program.force) console.log(' force: install'); pkgs.forEach(function(pkg){ console.log(' install : %s', pkg); }); console.log(); commander.js-2.20.0/examples/pm-publish.js000066400000000000000000000001111345100027400203740ustar00rootroot00000000000000'use strict'; if (true) { let info = 'publish'; console.log(info) } commander.js-2.20.0/examples/regex000066400000000000000000000006011345100027400170170ustar00rootroot00000000000000#!/usr/bin/env node /** * Module dependencies. */ var program = require('../'); program .version('0.0.1') .usage('test') .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium') .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i) .parse(process.argv); console.log(' size: %j', program.size); console.log(' drink: %j', program.drink); commander.js-2.20.0/index.js000066400000000000000000000663531345100027400156310ustar00rootroot00000000000000/** * Module dependencies. */ var EventEmitter = require('events').EventEmitter; var spawn = require('child_process').spawn; var path = require('path'); var dirname = path.dirname; var basename = path.basename; var fs = require('fs'); /** * Inherit `Command` from `EventEmitter.prototype`. */ require('util').inherits(Command, EventEmitter); /** * Expose the root command. */ exports = module.exports = new Command(); /** * Expose `Command`. */ exports.Command = Command; /** * Expose `Option`. */ exports.Option = Option; /** * Initialize a new `Option` with the given `flags` and `description`. * * @param {String} flags * @param {String} description * @api public */ function Option(flags, description) { this.flags = flags; this.required = flags.indexOf('<') >= 0; this.optional = flags.indexOf('[') >= 0; this.bool = flags.indexOf('-no-') === -1; flags = flags.split(/[ ,|]+/); if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); this.long = flags.shift(); this.description = description || ''; } /** * Return option name. * * @return {String} * @api private */ Option.prototype.name = function() { return this.long .replace('--', '') .replace('no-', ''); }; /** * Return option name, in a camelcase format that can be used * as a object attribute key. * * @return {String} * @api private */ Option.prototype.attributeName = function() { return camelcase(this.name()); }; /** * Check if `arg` matches the short or long flag. * * @param {String} arg * @return {Boolean} * @api private */ Option.prototype.is = function(arg) { return this.short === arg || this.long === arg; }; /** * Initialize a new `Command`. * * @param {String} name * @api public */ function Command(name) { this.commands = []; this.options = []; this._execs = {}; this._allowUnknownOption = false; this._args = []; this._name = name || ''; } /** * Add command `name`. * * The `.action()` callback is invoked when the * command `name` is specified via __ARGV__, * and the remaining arguments are applied to the * function for access. * * When the `name` is "*" an un-matched command * will be passed as the first arg, followed by * the rest of __ARGV__ remaining. * * Examples: * * program * .version('0.0.1') * .option('-C, --chdir ', 'change the working directory') * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') * .option('-T, --no-tests', 'ignore test hook') * * program * .command('setup') * .description('run remote setup commands') * .action(function() { * console.log('setup'); * }); * * program * .command('exec ') * .description('run the given remote command') * .action(function(cmd) { * console.log('exec "%s"', cmd); * }); * * program * .command('teardown [otherDirs...]') * .description('run teardown commands') * .action(function(dir, otherDirs) { * console.log('dir "%s"', dir); * if (otherDirs) { * otherDirs.forEach(function (oDir) { * console.log('dir "%s"', oDir); * }); * } * }); * * program * .command('*') * .description('deploy the given env') * .action(function(env) { * console.log('deploying "%s"', env); * }); * * program.parse(process.argv); * * @param {String} name * @param {String} [desc] for git-style sub-commands * @return {Command} the new command * @api public */ Command.prototype.command = function(name, desc, opts) { if (typeof desc === 'object' && desc !== null) { opts = desc; desc = null; } opts = opts || {}; var args = name.split(/ +/); var cmd = new Command(args.shift()); if (desc) { cmd.description(desc); this.executables = true; this._execs[cmd._name] = true; if (opts.isDefault) this.defaultExecutable = cmd._name; } cmd._noHelp = !!opts.noHelp; this.commands.push(cmd); cmd.parseExpectedArgs(args); cmd.parent = this; if (desc) return this; return cmd; }; /** * Define argument syntax for the top-level command. * * @api public */ Command.prototype.arguments = function(desc) { return this.parseExpectedArgs(desc.split(/ +/)); }; /** * Add an implicit `help [cmd]` subcommand * which invokes `--help` for the given command. * * @api private */ Command.prototype.addImplicitHelpCommand = function() { this.command('help [cmd]', 'display help for [cmd]'); }; /** * Parse expected `args`. * * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. * * @param {Array} args * @return {Command} for chaining * @api public */ Command.prototype.parseExpectedArgs = function(args) { if (!args.length) return; var self = this; args.forEach(function(arg) { var argDetails = { required: false, name: '', variadic: false }; switch (arg[0]) { case '<': argDetails.required = true; argDetails.name = arg.slice(1, -1); break; case '[': argDetails.name = arg.slice(1, -1); break; } if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { argDetails.variadic = true; argDetails.name = argDetails.name.slice(0, -3); } if (argDetails.name) { self._args.push(argDetails); } }); return this; }; /** * Register callback `fn` for the command. * * Examples: * * program * .command('help') * .description('display verbose help') * .action(function() { * // output help here * }); * * @param {Function} fn * @return {Command} for chaining * @api public */ Command.prototype.action = function(fn) { var self = this; var listener = function(args, unknown) { // Parse any so-far unknown options args = args || []; unknown = unknown || []; var parsed = self.parseOptions(unknown); // Output help if necessary outputHelpIfNecessary(self, parsed.unknown); // If there are still any unknown options, then we simply // die, unless someone asked for help, in which case we give it // to them, and then we die. if (parsed.unknown.length > 0) { self.unknownOption(parsed.unknown[0]); } // Leftover arguments need to be pushed back. Fixes issue #56 if (parsed.args.length) args = parsed.args.concat(args); self._args.forEach(function(arg, i) { if (arg.required && args[i] == null) { self.missingArgument(arg.name); } else if (arg.variadic) { if (i !== self._args.length - 1) { self.variadicArgNotLast(arg.name); } args[i] = args.splice(i); } }); // Always append ourselves to the end of the arguments, // to make sure we match the number of arguments the user // expects if (self._args.length) { args[self._args.length] = self; } else { args.push(self); } fn.apply(self, args); }; var parent = this.parent || this; var name = parent === this ? '*' : this._name; parent.on('command:' + name, listener); if (this._alias) parent.on('command:' + this._alias, listener); return this; }; /** * Define option with `flags`, `description` and optional * coercion `fn`. * * The `flags` string should contain both the short and long flags, * separated by comma, a pipe or space. The following are all valid * all will output this way when `--help` is used. * * "-p, --pepper" * "-p|--pepper" * "-p --pepper" * * Examples: * * // simple boolean defaulting to false * program.option('-p, --pepper', 'add pepper'); * * --pepper * program.pepper * // => Boolean * * // simple boolean defaulting to true * program.option('-C, --no-cheese', 'remove cheese'); * * program.cheese * // => true * * --no-cheese * program.cheese * // => false * * // required argument * program.option('-C, --chdir ', 'change the working directory'); * * --chdir /tmp * program.chdir * // => "/tmp" * * // optional argument * program.option('-c, --cheese [type]', 'add cheese [marble]'); * * @param {String} flags * @param {String} description * @param {Function|*} [fn] or default * @param {*} [defaultValue] * @return {Command} for chaining * @api public */ Command.prototype.option = function(flags, description, fn, defaultValue) { var self = this, option = new Option(flags, description), oname = option.name(), name = option.attributeName(); // default as 3rd arg if (typeof fn !== 'function') { if (fn instanceof RegExp) { var regex = fn; fn = function(val, def) { var m = regex.exec(val); return m ? m[0] : def; }; } else { defaultValue = fn; fn = null; } } // preassign default value only for --no-*, [optional], or if (!option.bool || option.optional || option.required) { // when --no-* we make sure default is true if (!option.bool) defaultValue = true; // preassign only if we have a default if (defaultValue !== undefined) { self[name] = defaultValue; option.defaultValue = defaultValue; } } // register the option this.options.push(option); // when it's passed assign the value // and conditionally invoke the callback this.on('option:' + oname, function(val) { // coercion if (val !== null && fn) { val = fn(val, self[name] === undefined ? defaultValue : self[name]); } // unassigned or bool if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') { // if no value, bool true, and we have a default, then use it! if (val == null) { self[name] = option.bool ? defaultValue || true : false; } else { self[name] = val; } } else if (val !== null) { // reassign self[name] = val; } }); return this; }; /** * Allow unknown options on the command line. * * @param {Boolean} arg if `true` or omitted, no error will be thrown * for unknown options. * @api public */ Command.prototype.allowUnknownOption = function(arg) { this._allowUnknownOption = arguments.length === 0 || arg; return this; }; /** * Parse `argv`, settings options and invoking commands when defined. * * @param {Array} argv * @return {Command} for chaining * @api public */ Command.prototype.parse = function(argv) { // implicit help if (this.executables) this.addImplicitHelpCommand(); // store raw args this.rawArgs = argv; // guess name this._name = this._name || basename(argv[1], '.js'); // github-style sub-commands with no sub-command if (this.executables && argv.length < 3 && !this.defaultExecutable) { // this user needs help argv.push('--help'); } // process argv var parsed = this.parseOptions(this.normalize(argv.slice(2))); var args = this.args = parsed.args; var result = this.parseArgs(this.args, parsed.unknown); // executable sub-commands var name = result.args[0]; var aliasCommand = null; // check alias of sub commands if (name) { aliasCommand = this.commands.filter(function(command) { return command.alias() === name; })[0]; } if (this._execs[name] && typeof this._execs[name] !== 'function') { return this.executeSubCommand(argv, args, parsed.unknown); } else if (aliasCommand) { // is alias of a subCommand args[0] = aliasCommand._name; return this.executeSubCommand(argv, args, parsed.unknown); } else if (this.defaultExecutable) { // use the default subcommand args.unshift(this.defaultExecutable); return this.executeSubCommand(argv, args, parsed.unknown); } return result; }; /** * Execute a sub-command executable. * * @param {Array} argv * @param {Array} args * @param {Array} unknown * @api private */ Command.prototype.executeSubCommand = function(argv, args, unknown) { args = args.concat(unknown); if (!args.length) this.help(); if (args[0] === 'help' && args.length === 1) this.help(); // --help if (args[0] === 'help') { args[0] = args[1]; args[1] = '--help'; } // executable var f = argv[1]; // name of the subcommand, link `pm-install` var bin = basename(f, path.extname(f)) + '-' + args[0]; // In case of globally installed, get the base dir where executable // subcommand file should be located at var baseDir; var resolvedLink = fs.realpathSync(f); baseDir = dirname(resolvedLink); // prefer local `./` to bin in the $PATH var localBin = path.join(baseDir, bin); // whether bin file is a js script with explicit `.js` or `.ts` extension var isExplicitJS = false; if (exists(localBin + '.js')) { bin = localBin + '.js'; isExplicitJS = true; } else if (exists(localBin + '.ts')) { bin = localBin + '.ts'; isExplicitJS = true; } else if (exists(localBin)) { bin = localBin; } args = args.slice(1); var proc; if (process.platform !== 'win32') { if (isExplicitJS) { args.unshift(bin); // add executable arguments to spawn args = (process.execArgv || []).concat(args); proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] }); } else { proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] }); } } else { args.unshift(bin); proc = spawn(process.execPath, args, { stdio: 'inherit' }); } var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP']; signals.forEach(function(signal) { process.on(signal, function() { if (proc.killed === false && proc.exitCode === null) { proc.kill(signal); } }); }); proc.on('close', process.exit.bind(process)); proc.on('error', function(err) { if (err.code === 'ENOENT') { console.error('error: %s(1) does not exist, try --help', bin); } else if (err.code === 'EACCES') { console.error('error: %s(1) not executable. try chmod or run with root', bin); } process.exit(1); }); // Store the reference to the child process this.runningCommand = proc; }; /** * Normalize `args`, splitting joined short flags. For example * the arg "-abc" is equivalent to "-a -b -c". * This also normalizes equal sign and splits "--abc=def" into "--abc def". * * @param {Array} args * @return {Array} * @api private */ Command.prototype.normalize = function(args) { var ret = [], arg, lastOpt, index; for (var i = 0, len = args.length; i < len; ++i) { arg = args[i]; if (i > 0) { lastOpt = this.optionFor(args[i - 1]); } if (arg === '--') { // Honor option terminator ret = ret.concat(args.slice(i)); break; } else if (lastOpt && lastOpt.required) { ret.push(arg); } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') { arg.slice(1).split('').forEach(function(c) { ret.push('-' + c); }); } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { ret.push(arg.slice(0, index), arg.slice(index + 1)); } else { ret.push(arg); } } return ret; }; /** * Parse command `args`. * * When listener(s) are available those * callbacks are invoked, otherwise the "*" * event is emitted and those actions are invoked. * * @param {Array} args * @return {Command} for chaining * @api private */ Command.prototype.parseArgs = function(args, unknown) { var name; if (args.length) { name = args[0]; if (this.listeners('command:' + name).length) { this.emit('command:' + args.shift(), args, unknown); } else { this.emit('command:*', args); } } else { outputHelpIfNecessary(this, unknown); // If there were no args and we have unknown options, // then they are extraneous and we need to error. if (unknown.length > 0) { this.unknownOption(unknown[0]); } if (this.commands.length === 0 && this._args.filter(function(a) { return a.required; }).length === 0) { this.emit('command:*'); } } return this; }; /** * Return an option matching `arg` if any. * * @param {String} arg * @return {Option} * @api private */ Command.prototype.optionFor = function(arg) { for (var i = 0, len = this.options.length; i < len; ++i) { if (this.options[i].is(arg)) { return this.options[i]; } } }; /** * Parse options from `argv` returning `argv` * void of these options. * * @param {Array} argv * @return {Array} * @api public */ Command.prototype.parseOptions = function(argv) { var args = [], len = argv.length, literal, option, arg; var unknownOptions = []; // parse options for (var i = 0; i < len; ++i) { arg = argv[i]; // literal args after -- if (literal) { args.push(arg); continue; } if (arg === '--') { literal = true; continue; } // find matching Option option = this.optionFor(arg); // option is defined if (option) { // requires arg if (option.required) { arg = argv[++i]; if (arg == null) return this.optionMissingArgument(option); this.emit('option:' + option.name(), arg); // optional arg } else if (option.optional) { arg = argv[i + 1]; if (arg == null || (arg[0] === '-' && arg !== '-')) { arg = null; } else { ++i; } this.emit('option:' + option.name(), arg); // bool } else { this.emit('option:' + option.name()); } continue; } // looks like an option if (arg.length > 1 && arg[0] === '-') { unknownOptions.push(arg); // If the next argument looks like it might be // an argument for this option, we pass it on. // If it isn't, then it'll simply be ignored if ((i + 1) < argv.length && argv[i + 1][0] !== '-') { unknownOptions.push(argv[++i]); } continue; } // arg args.push(arg); } return { args: args, unknown: unknownOptions }; }; /** * Return an object containing options as key-value pairs * * @return {Object} * @api public */ Command.prototype.opts = function() { var result = {}, len = this.options.length; for (var i = 0; i < len; i++) { var key = this.options[i].attributeName(); result[key] = key === this._versionOptionName ? this._version : this[key]; } return result; }; /** * Argument `name` is missing. * * @param {String} name * @api private */ Command.prototype.missingArgument = function(name) { console.error("error: missing required argument `%s'", name); process.exit(1); }; /** * `Option` is missing an argument, but received `flag` or nothing. * * @param {String} option * @param {String} flag * @api private */ Command.prototype.optionMissingArgument = function(option, flag) { if (flag) { console.error("error: option `%s' argument missing, got `%s'", option.flags, flag); } else { console.error("error: option `%s' argument missing", option.flags); } process.exit(1); }; /** * Unknown option `flag`. * * @param {String} flag * @api private */ Command.prototype.unknownOption = function(flag) { if (this._allowUnknownOption) return; console.error("error: unknown option `%s'", flag); process.exit(1); }; /** * Variadic argument with `name` is not the last argument as required. * * @param {String} name * @api private */ Command.prototype.variadicArgNotLast = function(name) { console.error("error: variadic arguments must be last `%s'", name); process.exit(1); }; /** * Set the program version to `str`. * * This method auto-registers the "-V, --version" flag * which will print the version number when passed. * * @param {String} str * @param {String} [flags] * @return {Command} for chaining * @api public */ Command.prototype.version = function(str, flags) { if (arguments.length === 0) return this._version; this._version = str; flags = flags || '-V, --version'; var versionOption = new Option(flags, 'output the version number'); this._versionOptionName = versionOption.long.substr(2) || 'version'; this.options.push(versionOption); this.on('option:' + this._versionOptionName, function() { process.stdout.write(str + '\n'); process.exit(0); }); return this; }; /** * Set the description to `str`. * * @param {String} str * @param {Object} argsDescription * @return {String|Command} * @api public */ Command.prototype.description = function(str, argsDescription) { if (arguments.length === 0) return this._description; this._description = str; this._argsDescription = argsDescription; return this; }; /** * Set an alias for the command * * @param {String} alias * @return {String|Command} * @api public */ Command.prototype.alias = function(alias) { var command = this; if (this.commands.length !== 0) { command = this.commands[this.commands.length - 1]; } if (arguments.length === 0) return command._alias; if (alias === command._name) throw new Error('Command alias can\'t be the same as its name'); command._alias = alias; return this; }; /** * Set / get the command usage `str`. * * @param {String} str * @return {String|Command} * @api public */ Command.prototype.usage = function(str) { var args = this._args.map(function(arg) { return humanReadableArgName(arg); }); var usage = '[options]' + (this.commands.length ? ' [command]' : '') + (this._args.length ? ' ' + args.join(' ') : ''); if (arguments.length === 0) return this._usage || usage; this._usage = str; return this; }; /** * Get or set the name of the command * * @param {String} str * @return {String|Command} * @api public */ Command.prototype.name = function(str) { if (arguments.length === 0) return this._name; this._name = str; return this; }; /** * Return prepared commands. * * @return {Array} * @api private */ Command.prototype.prepareCommands = function() { return this.commands.filter(function(cmd) { return !cmd._noHelp; }).map(function(cmd) { var args = cmd._args.map(function(arg) { return humanReadableArgName(arg); }).join(' '); return [ cmd._name + (cmd._alias ? '|' + cmd._alias : '') + (cmd.options.length ? ' [options]' : '') + (args ? ' ' + args : ''), cmd._description ]; }); }; /** * Return the largest command length. * * @return {Number} * @api private */ Command.prototype.largestCommandLength = function() { var commands = this.prepareCommands(); return commands.reduce(function(max, command) { return Math.max(max, command[0].length); }, 0); }; /** * Return the largest option length. * * @return {Number} * @api private */ Command.prototype.largestOptionLength = function() { var options = [].slice.call(this.options); options.push({ flags: '-h, --help' }); return options.reduce(function(max, option) { return Math.max(max, option.flags.length); }, 0); }; /** * Return the largest arg length. * * @return {Number} * @api private */ Command.prototype.largestArgLength = function() { return this._args.reduce(function(max, arg) { return Math.max(max, arg.name.length); }, 0); }; /** * Return the pad width. * * @return {Number} * @api private */ Command.prototype.padWidth = function() { var width = this.largestOptionLength(); if (this._argsDescription && this._args.length) { if (this.largestArgLength() > width) { width = this.largestArgLength(); } } if (this.commands && this.commands.length) { if (this.largestCommandLength() > width) { width = this.largestCommandLength(); } } return width; }; /** * Return help for options. * * @return {String} * @api private */ Command.prototype.optionHelp = function() { var width = this.padWidth(); // Append the help information return this.options.map(function(option) { return pad(option.flags, width) + ' ' + option.description + ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : ''); }).concat([pad('-h, --help', width) + ' ' + 'output usage information']) .join('\n'); }; /** * Return command help documentation. * * @return {String} * @api private */ Command.prototype.commandHelp = function() { if (!this.commands.length) return ''; var commands = this.prepareCommands(); var width = this.padWidth(); return [ 'Commands:', commands.map(function(cmd) { var desc = cmd[1] ? ' ' + cmd[1] : ''; return (desc ? pad(cmd[0], width) : cmd[0]) + desc; }).join('\n').replace(/^/gm, ' '), '' ].join('\n'); }; /** * Return program help documentation. * * @return {String} * @api private */ Command.prototype.helpInformation = function() { var desc = []; if (this._description) { desc = [ this._description, '' ]; var argsDescription = this._argsDescription; if (argsDescription && this._args.length) { var width = this.padWidth(); desc.push('Arguments:'); desc.push(''); this._args.forEach(function(arg) { desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]); }); desc.push(''); } } var cmdName = this._name; if (this._alias) { cmdName = cmdName + '|' + this._alias; } var usage = [ 'Usage: ' + cmdName + ' ' + this.usage(), '' ]; var cmds = []; var commandHelp = this.commandHelp(); if (commandHelp) cmds = [commandHelp]; var options = [ 'Options:', '' + this.optionHelp().replace(/^/gm, ' '), '' ]; return usage .concat(desc) .concat(options) .concat(cmds) .join('\n'); }; /** * Output help information for this command * * @api public */ Command.prototype.outputHelp = function(cb) { if (!cb) { cb = function(passthru) { return passthru; }; } process.stdout.write(cb(this.helpInformation())); this.emit('--help'); }; /** * Output help information and exit. * * @api public */ Command.prototype.help = function(cb) { this.outputHelp(cb); process.exit(); }; /** * Camel-case the given `flag` * * @param {String} flag * @return {String} * @api private */ function camelcase(flag) { return flag.split('-').reduce(function(str, word) { return str + word[0].toUpperCase() + word.slice(1); }); } /** * Pad `str` to `width`. * * @param {String} str * @param {Number} width * @return {String} * @api private */ function pad(str, width) { var len = Math.max(0, width - str.length); return str + Array(len + 1).join(' '); } /** * Output help information if necessary * * @param {Command} command to output help for * @param {Array} array of options to search for -h or --help * @api private */ function outputHelpIfNecessary(cmd, options) { options = options || []; for (var i = 0; i < options.length; i++) { if (options[i] === '--help' || options[i] === '-h') { cmd.outputHelp(); process.exit(0); } } } /** * Takes an argument an returns its human readable equivalent for help usage. * * @param {Object} arg * @return {String} * @api private */ function humanReadableArgName(arg) { var nameOutput = arg.name + (arg.variadic === true ? '...' : ''); return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']'; } // for versions before node v0.8 when there weren't `fs.existsSync` function exists(file) { try { if (fs.statSync(file).isFile()) { return true; } } catch (e) { return false; } } commander.js-2.20.0/package-lock.json000066400000000000000000002277661345100027400174070ustar00rootroot00000000000000{ "name": "commander", "version": "2.20.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "dev": true, "requires": { "@babel/highlight": "^7.0.0" } }, "@babel/highlight": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", "dev": true, "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", "js-tokens": "^4.0.0" }, "dependencies": { "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true } } }, "@sinonjs/commons": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.0.2.tgz", "integrity": "sha512-WR3dlgqJP4QNrLC4iXN/5/2WaLQQ0VijOOkmflqFGVJ6wLEpbSjo7c0ZeGIdtY8Crk7xBBp87sM6+Mkerz7alw==", "dev": true, "requires": { "type-detect": "4.0.8" } }, "@sinonjs/formatio": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.0.0.tgz", "integrity": "sha512-vdjoYLDptCgvtJs57ULshak3iJe4NW3sJ3g36xVDGff5AE8P30S6A093EIEPjdi2noGhfuNOEkbxt3J3awFW1w==", "dev": true, "requires": { "@sinonjs/samsam": "2.1.0" }, "dependencies": { "@sinonjs/samsam": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.1.0.tgz", "integrity": "sha512-5x2kFgJYupaF1ns/RmharQ90lQkd2ELS8A9X0ymkAAdemYHGtI2KiUHG8nX2WU0T1qgnOU5YMqnBM2V7NUanNw==", "dev": true, "requires": { "array-from": "^2.1.1" } } } }, "@sinonjs/samsam": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.1.1.tgz", "integrity": "sha512-7oX6PXMulvdN37h88dvlvRyu61GYZau40fL4wEZvPEHvrjpJc3lDv6xDM5n4Z0StufUVB5nDvVZUM+jZHdMOOQ==", "dev": true, "requires": { "array-from": "^2.1.1" } }, "@types/node": { "version": "10.11.3", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.3.tgz", "integrity": "sha512-3AvcEJAh9EMatxs+OxAlvAEs7OTy6AG94mcH1iqyVDwVVndekLxzwkWQ/Z4SDbY6GO2oyUXyWW8tQ4rENSSQVQ==", "dev": true }, "acorn": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", "dev": true }, "acorn-jsx": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz", "integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==", "dev": true, "requires": { "acorn": "^5.0.3" } }, "ajv": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "ajv-keywords": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", "dev": true }, "ansi-escapes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "~1.0.2" } }, "array-from": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", "dev": true }, "array-includes": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", "dev": true, "requires": { "define-properties": "^1.1.2", "es-abstract": "^1.7.0" } }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { "array-uniq": "^1.0.1" } }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", "dev": true }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { "chalk": "^1.1.3", "esutils": "^2.0.2", "js-tokens": "^3.0.2" }, "dependencies": { "chalk": { "version": "1.1.3", "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", "has-ansi": "^2.0.0", "strip-ansi": "^3.0.0", "supports-color": "^2.0.0" } }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" } } } }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "buffer-from": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", "dev": true }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, "requires": { "callsites": "^0.2.0" } }, "callsites": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, "chalk": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" }, "dependencies": { "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" } }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { "has-flag": "^3.0.0" } } } }, "chardet": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", "dev": true }, "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, "requires": { "restore-cursor": "^2.0.0" } }, "cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, "color-convert": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", "dev": true, "requires": { "color-name": "1.1.1" } }, "color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" } }, "debug-log": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", "dev": true }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { "object-keys": "^1.0.12" } }, "deglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz", "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==", "dev": true, "requires": { "find-root": "^1.0.0", "glob": "^7.0.5", "ignore": "^3.0.9", "pkg-config": "^1.1.0", "run-parallel": "^1.1.2", "uniq": "^1.0.1" }, "dependencies": { "ignore": { "version": "3.3.10", "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true } } }, "del": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "dev": true, "requires": { "globby": "^5.0.0", "is-path-cwd": "^1.0.0", "is-path-in-cwd": "^1.0.0", "object-assign": "^4.0.1", "pify": "^2.0.0", "pinkie-promise": "^2.0.0", "rimraf": "^2.2.8" } }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { "esutils": "^2.0.2" } }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" } }, "es-abstract": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", "dev": true, "requires": { "es-to-primitive": "^1.1.1", "function-bind": "^1.1.1", "has": "^1.0.1", "is-callable": "^1.1.3", "is-regex": "^1.0.4" } }, "es-to-primitive": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", "dev": true, "requires": { "is-callable": "^1.1.1", "is-date-object": "^1.0.1", "is-symbol": "^1.0.1" } }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "eslint": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.6.1.tgz", "integrity": "sha512-hgrDtGWz368b7Wqf+v1Z69O3ZebNR0+GA7PtDdbmuz4rInFVUV9uw7whjZEiWyLzCjVb5Rs5WRN1TAS6eo7AYA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.5.3", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", "debug": "^4.0.1", "doctrine": "^2.1.0", "eslint-scope": "^4.0.0", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", "espree": "^4.0.0", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^2.0.0", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", "ignore": "^4.0.6", "imurmurhash": "^0.1.4", "inquirer": "^6.1.0", "is-resolvable": "^1.1.0", "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", "lodash": "^4.17.5", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", "optionator": "^0.8.2", "path-is-inside": "^1.0.2", "pluralize": "^7.0.0", "progress": "^2.0.0", "regexpp": "^2.0.0", "require-uncached": "^1.0.3", "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", "table": "^4.0.3", "text-table": "^0.2.0" }, "dependencies": { "debug": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.0.1.tgz", "integrity": "sha512-K23FHJ/Mt404FSlp6gSZCevIbTMLX0j3fmHhUEhQ3Wq0FMODW3+cUSoLdy1Gx4polAf4t/lphhmHH35BB8cLYw==", "dev": true, "requires": { "ms": "^2.1.1" } }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, "semver": { "version": "5.5.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", "dev": true } } }, "eslint-config-standard": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz", "integrity": "sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ==", "dev": true }, "eslint-config-standard-jsx": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-6.0.2.tgz", "integrity": "sha512-D+YWAoXw+2GIdbMBRAzWwr1ZtvnSf4n4yL0gKGg7ShUOGXkSOLerI17K4F6LdQMJPNMoWYqepzQD/fKY+tXNSg==", "dev": true }, "eslint-import-resolver-node": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", "dev": true, "requires": { "debug": "^2.6.9", "resolve": "^1.5.0" }, "dependencies": { "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" } } } }, "eslint-module-utils": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz", "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=", "dev": true, "requires": { "debug": "^2.6.8", "pkg-dir": "^1.0.0" }, "dependencies": { "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" } } } }, "eslint-plugin-es": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.3.1.tgz", "integrity": "sha512-9XcVyZiQRVeFjqHw8qHNDAZcQLqaHlOGGpeYqzYh8S4JYCWTCO3yzyen8yVmA5PratfzTRWDwCOFphtDEG+w/w==", "dev": true, "requires": { "eslint-utils": "^1.3.0", "regexpp": "^2.0.0" } }, "eslint-plugin-import": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz", "integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==", "dev": true, "requires": { "contains-path": "^0.1.0", "debug": "^2.6.8", "doctrine": "1.5.0", "eslint-import-resolver-node": "^0.3.1", "eslint-module-utils": "^2.2.0", "has": "^1.0.1", "lodash": "^4.17.4", "minimatch": "^3.0.3", "read-pkg-up": "^2.0.0", "resolve": "^1.6.0" }, "dependencies": { "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" } }, "doctrine": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { "esutils": "^2.0.2", "isarray": "^1.0.0" } }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true } } }, "eslint-plugin-node": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz", "integrity": "sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw==", "dev": true, "requires": { "eslint-plugin-es": "^1.3.1", "eslint-utils": "^1.3.1", "ignore": "^4.0.2", "minimatch": "^3.0.4", "resolve": "^1.8.1", "semver": "^5.5.0" } }, "eslint-plugin-promise": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz", "integrity": "sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg==", "dev": true }, "eslint-plugin-react": { "version": "7.11.1", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz", "integrity": "sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw==", "dev": true, "requires": { "array-includes": "^3.0.3", "doctrine": "^2.1.0", "has": "^1.0.3", "jsx-ast-utils": "^2.0.1", "prop-types": "^15.6.2" } }, "eslint-plugin-standard": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.0.tgz", "integrity": "sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA==", "dev": true }, "eslint-scope": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", "dev": true, "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } }, "eslint-utils": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", "dev": true }, "eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", "dev": true }, "espree": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/espree/-/espree-4.0.0.tgz", "integrity": "sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg==", "dev": true, "requires": { "acorn": "^5.6.0", "acorn-jsx": "^4.1.1" } }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, "esquery": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { "estraverse": "^4.0.0" } }, "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { "estraverse": "^4.1.0" } }, "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", "dev": true }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, "external-editor": { "version": "2.2.0", "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "dev": true, "requires": { "chardet": "^0.4.0", "iconv-lite": "^0.4.17", "tmp": "^0.0.33" } }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", "dev": true }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" } }, "file-entry-cache": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { "flat-cache": "^1.2.1", "object-assign": "^4.0.1" } }, "find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", "dev": true }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "^2.0.0", "pinkie-promise": "^2.0.0" } }, "flat-cache": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { "circular-json": "^0.3.1", "del": "^2.0.2", "graceful-fs": "^4.1.2", "write": "^0.2.1" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, "get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "globals": { "version": "11.7.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", "dev": true }, "globby": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { "array-union": "^1.0.1", "arrify": "^1.0.0", "glob": "^7.0.3", "object-assign": "^4.0.1", "pify": "^2.0.0", "pinkie-promise": "^2.0.0" } }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { "function-bind": "^1.1.1" } }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { "ansi-regex": "^2.0.0" } }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" } }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" } }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "inquirer": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", "chalk": "^2.0.0", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", "external-editor": "^3.0.0", "figures": "^2.0.0", "lodash": "^4.17.10", "mute-stream": "0.0.7", "run-async": "^2.2.0", "rxjs": "^6.1.0", "string-width": "^2.1.0", "strip-ansi": "^4.0.0", "through": "^2.3.6" }, "dependencies": { "chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "external-editor": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", "dev": true, "requires": { "chardet": "^0.7.0", "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } } } }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-builtin-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { "builtin-modules": "^1.0.0" } }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", "dev": true }, "is-path-in-cwd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { "is-path-inside": "^1.0.0" } }, "is-path-inside": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { "path-is-inside": "^1.0.1" } }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { "has": "^1.0.1" } }, "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-symbol": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", "dev": true }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, "js-yaml": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" } }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, "jsx-ast-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz", "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", "dev": true, "requires": { "array-includes": "^3.0.3" } }, "just-extend": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-3.0.0.tgz", "integrity": "sha512-Fu3T6pKBuxjWT/p4DkqGHFRsysc8OauWr4ZRTY9dIx07Y9O0RkoR5jcv28aeD1vuAwhm3nLkDurwLXoALp4DpQ==", "dev": true }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" } }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { "graceful-fs": "^4.1.2", "parse-json": "^2.2.0", "pify": "^2.0.0", "strip-bom": "^3.0.0" } }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" }, "dependencies": { "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true } } }, "lodash": { "version": "4.17.10", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", "dev": true }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, "lolex": { "version": "2.7.5", "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", "dev": true }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "requires": { "js-tokens": "^3.0.0 || ^4.0.0" } }, "make-error": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz", "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==", "dev": true }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "mute-stream": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "nise": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.5.tgz", "integrity": "sha512-OHRVvdxKgwZELf2DTgsJEIA4MOq8XWvpSUzoOXyxJ2mY0mMENWC66+70AShLR2z05B1dzrzWlUQJmJERlOUpZw==", "dev": true, "requires": { "@sinonjs/formatio": "3.0.0", "just-extend": "^3.0.0", "lolex": "^2.3.2", "path-to-regexp": "^1.7.0", "text-encoding": "^0.6.4" } }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", "is-builtin-module": "^1.0.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" } }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, "object-keys": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", "dev": true }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" } }, "onetime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { "mimic-fn": "^1.0.0" } }, "optionator": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.4", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", "wordwrap": "~1.0.0" } }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { "p-try": "^1.0.0" } }, "p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { "p-limit": "^1.1.0" } }, "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { "error-ex": "^1.2.0" } }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { "pinkie-promise": "^2.0.0" } }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "path-is-inside": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-to-regexp": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", "dev": true, "requires": { "isarray": "0.0.1" } }, "path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "dev": true, "requires": { "pify": "^2.0.0" } }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "^2.0.0" } }, "pkg-conf": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", "dev": true, "requires": { "find-up": "^2.0.0", "load-json-file": "^4.0.0" }, "dependencies": { "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "^2.0.0" } }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { "graceful-fs": "^4.1.2", "parse-json": "^4.0.0", "pify": "^3.0.0", "strip-bom": "^3.0.0" } }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" } }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true } } }, "pkg-config": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=", "dev": true, "requires": { "debug-log": "^1.0.0", "find-root": "^1.0.0", "xtend": "^4.0.1" } }, "pkg-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", "dev": true, "requires": { "find-up": "^1.0.0" } }, "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, "progress": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", "dev": true }, "prop-types": { "version": "15.6.2", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz", "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==", "dev": true, "requires": { "loose-envify": "^1.3.1", "object-assign": "^4.1.1" } }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { "load-json-file": "^2.0.0", "normalize-package-data": "^2.3.2", "path-type": "^2.0.0" } }, "read-pkg-up": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { "find-up": "^2.0.0", "read-pkg": "^2.0.0" }, "dependencies": { "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "^2.0.0" } } } }, "regexpp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz", "integrity": "sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA==", "dev": true }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { "caller-path": "^0.1.0", "resolve-from": "^1.0.0" } }, "resolve": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "dev": true, "requires": { "path-parse": "^1.0.5" } }, "resolve-from": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { "onetime": "^2.0.0", "signal-exit": "^3.0.2" } }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { "glob": "^7.0.5" } }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "dev": true, "requires": { "is-promise": "^2.1.0" } }, "run-parallel": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", "dev": true }, "rxjs": { "version": "6.3.3", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", "dev": true, "requires": { "tslib": "^1.9.0" } }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { "shebang-regex": "^1.0.0" } }, "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "should": { "version": "13.2.3", "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", "dev": true, "requires": { "should-equal": "^2.0.0", "should-format": "^3.0.3", "should-type": "^1.4.0", "should-type-adaptors": "^1.0.1", "should-util": "^1.0.0" } }, "should-equal": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", "dev": true, "requires": { "should-type": "^1.4.0" } }, "should-format": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", "dev": true, "requires": { "should-type": "^1.3.0", "should-type-adaptors": "^1.0.1" } }, "should-type": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=", "dev": true }, "should-type-adaptors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", "dev": true, "requires": { "should-type": "^1.3.0", "should-util": "^1.0.0" } }, "should-util": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz", "integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=", "dev": true }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "sinon": { "version": "6.3.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-6.3.4.tgz", "integrity": "sha512-NIaR56Z1mefuRBXYrf4otqBxkWiKveX+fvqs3HzFq2b07HcgpkMgIwmQM/owNjNFAHkx0kJXW+Q0mDthiuslXw==", "dev": true, "requires": { "@sinonjs/commons": "^1.0.2", "@sinonjs/formatio": "^3.0.0", "@sinonjs/samsam": "^2.1.1", "diff": "^3.5.0", "lodash.get": "^4.4.2", "lolex": "^2.7.4", "nise": "^1.4.5", "supports-color": "^5.5.0", "type-detect": "^4.0.8" }, "dependencies": { "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" } } } }, "slice-ansi": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0" } }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "source-map-support": { "version": "0.5.8", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.8.tgz", "integrity": "sha512-WqAEWPdb78u25RfKzOF0swBpY0dKrNdjc4GvLwm7ScX/o9bj8Eh/YL8mcMhBHYDGl87UkkSXDOFnW4G7GhWhGg==", "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", "dev": true }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, "standard": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/standard/-/standard-12.0.1.tgz", "integrity": "sha512-UqdHjh87OG2gUrNCSM4QRLF5n9h3TFPwrCNyVlkqu31Hej0L/rc8hzKqVvkb2W3x0WMq7PzZdkLfEcBhVOR6lg==", "dev": true, "requires": { "eslint": "~5.4.0", "eslint-config-standard": "12.0.0", "eslint-config-standard-jsx": "6.0.2", "eslint-plugin-import": "~2.14.0", "eslint-plugin-node": "~7.0.1", "eslint-plugin-promise": "~4.0.0", "eslint-plugin-react": "~7.11.1", "eslint-plugin-standard": "~4.0.0", "standard-engine": "~9.0.0" }, "dependencies": { "eslint": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz", "integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==", "dev": true, "requires": { "ajv": "^6.5.0", "babel-code-frame": "^6.26.0", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", "debug": "^3.1.0", "doctrine": "^2.1.0", "eslint-scope": "^4.0.0", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", "espree": "^4.0.0", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^2.0.0", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", "ignore": "^4.0.2", "imurmurhash": "^0.1.4", "inquirer": "^5.2.0", "is-resolvable": "^1.1.0", "js-yaml": "^3.11.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", "lodash": "^4.17.5", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", "optionator": "^0.8.2", "path-is-inside": "^1.0.2", "pluralize": "^7.0.0", "progress": "^2.0.0", "regexpp": "^2.0.0", "require-uncached": "^1.0.3", "semver": "^5.5.0", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", "table": "^4.0.3", "text-table": "^0.2.0" } }, "inquirer": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", "chalk": "^2.0.0", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", "external-editor": "^2.1.0", "figures": "^2.0.0", "lodash": "^4.3.0", "mute-stream": "0.0.7", "run-async": "^2.2.0", "rxjs": "^5.5.2", "string-width": "^2.1.0", "strip-ansi": "^4.0.0", "through": "^2.3.6" } }, "rxjs": { "version": "5.5.12", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", "dev": true, "requires": { "symbol-observable": "1.0.1" } } } }, "standard-engine": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-9.0.0.tgz", "integrity": "sha512-ZfNfCWZ2Xq67VNvKMPiVMKHnMdvxYzvZkf1AH8/cw2NLDBm5LRsxMqvEJpsjLI/dUosZ3Z1d6JlHDp5rAvvk2w==", "dev": true, "requires": { "deglob": "^2.1.0", "get-stdin": "^6.0.0", "minimist": "^1.1.0", "pkg-conf": "^2.0.0" }, "dependencies": { "minimist": { "version": "1.2.0", "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" } }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { "ansi-regex": "^3.0.0" }, "dependencies": { "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true } } }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, "symbol-observable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", "dev": true }, "table": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", "dev": true, "requires": { "ajv": "^6.0.1", "ajv-keywords": "^3.0.0", "chalk": "^2.1.0", "lodash": "^4.17.4", "slice-ansi": "1.0.0", "string-width": "^2.1.1" } }, "text-encoding": { "version": "0.6.4", "resolved": "http://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", "dev": true }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "~1.0.2" } }, "ts-node": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", "dev": true, "requires": { "arrify": "^1.0.0", "buffer-from": "^1.1.0", "diff": "^3.1.0", "make-error": "^1.1.1", "minimist": "^1.2.0", "mkdirp": "^0.5.1", "source-map-support": "^0.5.6", "yn": "^2.0.0" }, "dependencies": { "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } }, "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", "dev": true }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { "prelude-ls": "~1.1.2" } }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, "typescript": { "version": "2.9.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", "dev": true }, "uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", "dev": true }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "dev": true, "requires": { "punycode": "^2.1.0" } }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" } }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "write": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, "requires": { "mkdirp": "^0.5.1" } }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true }, "yn": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", "dev": true } } } commander.js-2.20.0/package.json000066400000000000000000000015411345100027400164360ustar00rootroot00000000000000{ "name": "commander", "version": "2.20.0", "description": "the complete solution for node.js command-line programs", "keywords": [ "commander", "command", "option", "parser" ], "author": "TJ Holowaychuk ", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/tj/commander.js.git" }, "scripts": { "lint": "eslint index.js", "test": "node test/run.js && npm run test-typings", "test-typings": "tsc -p tsconfig.json" }, "main": "index", "files": [ "index.js", "typings/index.d.ts" ], "dependencies": {}, "devDependencies": { "@types/node": "^10.11.3", "eslint": "^5.6.1", "should": "^13.2.3", "sinon": "^6.3.4", "standard": "^12.0.1", "ts-node": "^7.0.1", "typescript": "^2.9.2" }, "typings": "typings/index.d.ts" } commander.js-2.20.0/test/000077500000000000000000000000001345100027400151265ustar00rootroot00000000000000commander.js-2.20.0/test/fixtures-ts/000077500000000000000000000000001345100027400174235ustar00rootroot00000000000000commander.js-2.20.0/test/fixtures-ts/pm-install.ts000066400000000000000000000000551345100027400220530ustar00rootroot00000000000000#!/usr/bin/env node console.log('install'); commander.js-2.20.0/test/fixtures-ts/pm.ts000066400000000000000000000002561345100027400204120ustar00rootroot00000000000000#!/usr/bin/env node var program = require('../../'); program .version('0.0.1') .command('install [name]', 'install one or more packages') .parse(process.argv); commander.js-2.20.0/test/fixtures/000077500000000000000000000000001345100027400167775ustar00rootroot00000000000000commander.js-2.20.0/test/fixtures/another-dir/000077500000000000000000000000001345100027400212135ustar00rootroot00000000000000commander.js-2.20.0/test/fixtures/another-dir/pm000077700000000000000000000000001345100027400242142../other-dir/pmustar00rootroot00000000000000commander.js-2.20.0/test/fixtures/other-dir/000077500000000000000000000000001345100027400206745ustar00rootroot00000000000000commander.js-2.20.0/test/fixtures/other-dir/pm000077700000000000000000000000001345100027400220002../pmustar00rootroot00000000000000commander.js-2.20.0/test/fixtures/pm000077500000000000000000000010661345100027400173440ustar00rootroot00000000000000#!/usr/bin/env node var program = require('../../'); program .version('0.0.1') .command('install [name]', 'install one or more packages').alias('i') .command('search [query]', 'search with optional query').alias('s') .command('cache', 'actions dealing with the cache').alias('c') .command('list', 'list packages installed') .command('listen', 'listen for supported signal events').alias('l') .command('publish', 'publish or update package').alias('p') .command('default', 'default command', {noHelp: true, isDefault: true}) .parse(process.argv); commander.js-2.20.0/test/fixtures/pm-cache-clear.js000066400000000000000000000000331345100027400220720ustar00rootroot00000000000000console.log('cache-clear') commander.js-2.20.0/test/fixtures/pm-cache-validate.js000066400000000000000000000000361345100027400226000ustar00rootroot00000000000000console.log('cache-validate') commander.js-2.20.0/test/fixtures/pm-cache.js000066400000000000000000000002531345100027400210120ustar00rootroot00000000000000var program = require('../../'); program .command('clear', 'clear the cache') .command('validate', 'validate the cache', { isDefault: true }) .parse(process.argv); commander.js-2.20.0/test/fixtures/pm-default000077500000000000000000000000541345100027400207620ustar00rootroot00000000000000#!/usr/bin/env node console.log('default'); commander.js-2.20.0/test/fixtures/pm-install000077500000000000000000000000541345100027400210040ustar00rootroot00000000000000#!/usr/bin/env node console.log('install') commander.js-2.20.0/test/fixtures/pm-listen000077500000000000000000000007771345100027400206500ustar00rootroot00000000000000#!/usr/bin/env node process.on('SIGUSR1', function(){ console.log('SIGUSR1'); process.exit(); }); process.on('SIGUSR2', function(){ console.log('SIGUSR2'); process.exit(); }); process.on('SIGTERM', function(){ console.log('SIGTERM'); process.exit(); }); process.on('SIGINT', function(){ console.log('SIGINT'); process.exit(); }); process.on('SIGHUP', function(){ console.log('SIGHUP'); process.exit(); }); setInterval(function(){}, 5000); // Mimic a running processcommander.js-2.20.0/test/fixtures/pm-publish.js000066400000000000000000000000311345100027400214070ustar00rootroot00000000000000console.log('publish'); commander.js-2.20.0/test/fixtures/pm-search000066400000000000000000000000531345100027400205770ustar00rootroot00000000000000#!/usr/bin/env node console.log('search') commander.js-2.20.0/test/fixtures/pmlink000077700000000000000000000000001345100027400207032./pmustar00rootroot00000000000000commander.js-2.20.0/test/fixtures/pmlink-install000077500000000000000000000000541345100027400216620ustar00rootroot00000000000000#!/usr/bin/env node console.log('install') commander.js-2.20.0/test/run.js000066400000000000000000000012711345100027400162710ustar00rootroot00000000000000#!/usr/bin/env node const { spawnSync } = require('child_process') const { readdirSync } = require('fs') const { extname, join } = require('path') process.env.NODE_ENV = 'test'; process.stdout.write('\n') readdirSync(__dirname).forEach((file) => { if (!file.startsWith('test.') || extname(file) !== '.js') return; process.stdout.write(`\x1b[90m ${file}\x1b[0m `); const result = spawnSync(process.argv0, [ join('test', file) ]); if (result.status === 0) { process.stdout.write('\x1b[36m✓\x1b[0m\n'); } else { process.stdout.write('\x1b[31m✖\x1b[0m\n'); console.error(result.stderr.toString('utf8')); process.exit(result.status); } }) commander.js-2.20.0/test/test.arguments.js000066400000000000000000000014471345100027400204550ustar00rootroot00000000000000/** * Top-level command syntax. */ var program = require('../') , should = require('should'); var envValue = ""; var cmdValue = ""; program .version('0.0.1') .arguments(' [env]') .action(function (cmd, env) { cmdValue = cmd; envValue = env; }) .option('-C, --chdir ', 'change the working directory') .option('-c, --config ', 'set config path. defaults to ./deploy.conf') .option('-T, --no-tests', 'ignore test hook'); program.parse(['node', 'test', '--config', 'conf']); program.config.should.equal("conf"); cmdValue.should.equal(""); envValue.should.equal(""); program.parse(['node', 'test', '--config', 'conf1', 'setup', '--setup_mode', 'mode3', 'env1']); program.config.should.equal("conf1"); cmdValue.should.equal("setup"); envValue.should.equal("env1"); commander.js-2.20.0/test/test.command.action.emptyOption.js000066400000000000000000000005761345100027400236720ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); var val = "some cheese" program .name('test') .command('mycommand') .option('-c, --cheese [type]', 'optionally specify the type of cheese') .action(function(cmd) { val = cmd.cheese; }); program.parse(['node', 'test', 'mycommand', '--cheese', '']); val.should.equal(''); commander.js-2.20.0/test/test.command.action.js000066400000000000000000000004651345100027400213410ustar00rootroot00000000000000var program = require('../') , should = require('should'); var val = false; program .command('info [options]') .option('-C, --no-color', 'turn off color output') .action(function () { val = this.color; }); program.parse(['node', 'test', 'info']); program.commands[0].color.should.equal(val); commander.js-2.20.0/test/test.command.alias.help.js000066400000000000000000000006321345100027400221000ustar00rootroot00000000000000var program = require('../') , should = require('should'); program .command('info [thing]') .alias('i') .action(function () { }); program .command('save [file]') .alias('s') .action(function() { }); program.parse(['node', 'test']); program.commandHelp().should.containEql('info|i'); program.commandHelp().should.containEql('save|s'); program.commandHelp().should.not.containEql('test|'); commander.js-2.20.0/test/test.command.allowUnknownOption.js000066400000000000000000000022751345100027400237540ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , sinon = require('sinon').sandbox.create() , should = require('should'); var stubError = sinon.stub(console, 'error'); var stubExit = sinon.stub(process, 'exit'); program .version('0.0.1') .option('-p, --pepper', 'add pepper'); program.parse('node test -m'.split(' ')); stubError.callCount.should.equal(1); // test subcommand resetStubStatus(); program .command('sub') .action(function () { }); program.parse('node test sub -m'.split(' ')); stubError.callCount.should.equal(1); stubExit.calledOnce.should.be.true(); // command with `allowUnknownOption` resetStubStatus(); program .version('0.0.1') .option('-p, --pepper', 'add pepper'); program .allowUnknownOption() .parse('node test -m'.split(' ')); stubError.callCount.should.equal(0); stubExit.calledOnce.should.be.false(); // subcommand with `allowUnknownOption` resetStubStatus(); program .command('sub2') .allowUnknownOption() .action(function () { }); program.parse('node test sub2 -m'.split(' ')); stubError.callCount.should.equal(0); stubExit.calledOnce.should.be.false(); function resetStubStatus() { stubError.reset(); stubExit.reset(); } commander.js-2.20.0/test/test.command.executableSubcommand.js000066400000000000000000000024631345100027400242160ustar00rootroot00000000000000var exec = require('child_process').exec , path = require('path') , should = require('should'); var bin = path.join(__dirname, './fixtures/pm') // not exist exec(bin + ' list', function (error, stdout, stderr) { //stderr.should.equal('\n pm-list(1) does not exist, try --help\n\n'); // TODO error info are not the same in between <=v0.8 and later version should.notEqual(0, stderr.length); }); // success case exec(bin + ' install', function (error, stdout, stderr) { stdout.should.equal('install\n'); }); // subcommand bin file with explicit extension exec(bin + ' publish', function (error, stdout, stderr) { stdout.should.equal('publish\n'); }); // spawn EACCES exec(bin + ' search', function (error, stdout, stderr) { // TODO error info are not the same in between ' argument missing"); process.exit(0) }); program .version('0.0.1') .option('-c, --cheese ', 'optionally specify the type of cheese'); program.parse(['node', 'test', '--cheese']); commander.js-2.20.0/test/test.options.bool.js000066400000000000000000000005021345100027400210640ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-p, --pepper', 'add pepper') .option('-c, --no-cheese', 'remove cheese'); program.parse(['node', 'test', '--pepper']); program.pepper.should.be.true(); program.cheese.should.be.true(); commander.js-2.20.0/test/test.options.bool.no.js000066400000000000000000000005151345100027400215030ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-p, --pepper', 'add pepper') .option('-c|--no-cheese', 'remove cheese'); program.parse(['node', 'test', '--no-cheese']); should.equal(undefined, program.pepper); program.cheese.should.be.false(); commander.js-2.20.0/test/test.options.bool.small.combined.js000066400000000000000000000004761345100027400237640ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-p, --pepper', 'add pepper') .option('-c, --no-cheese', 'remove cheese'); program.parse(['node', 'test', '-pc']); program.pepper.should.be.true(); program.cheese.should.be.false(); commander.js-2.20.0/test/test.options.bool.small.js000066400000000000000000000005031345100027400221740ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-p, --pepper', 'add pepper') .option('-c, --no-cheese', 'remove cheese'); program.parse(['node', 'test', '-p', '-c']); program.pepper.should.be.true(); program.cheese.should.be.false(); commander.js-2.20.0/test/test.options.camelcase.js000066400000000000000000000015471345100027400220600ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); function parseRange(str) { return str.split('..').map(Number); } program .version('0.0.1') .option('-i, --my-int ', 'pass an int', parseInt) .option('-n, --my-num ', 'pass a number', Number) .option('-f, --my-fLOAT ', 'pass a float', parseFloat) .option('-m, --my-very-long-float ', 'pass a float', parseFloat) .option('-u, --my-URL-count ', 'pass a float', parseFloat) .option('-r, --my-long-range ', 'pass a range', parseRange); program.parse('node test -i 5.5 -f 5.5 -m 6.5 -u 7.5 -n 15.99 -r 1..5'.split(' ')); program.myInt.should.equal(5); program.myNum.should.equal(15.99); program.myFLOAT.should.equal(5.5); program.myVeryLongFloat.should.equal(6.5); program.myURLCount.should.equal(7.5); program.myLongRange.should.eql([1, 5]); commander.js-2.20.0/test/test.options.cflags.js000066400000000000000000000012541345100027400213750ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-c, --cflags ', 'pass options/flags to a compiler') .option('-o, --other', 'just some other option') .option('-x, --xother', 'just some other option') .option('-y, --yother', 'just some other option') .option('-z, --zother', 'just some other option'); program.parse(['node', 'test', '--cflags', '-DDEBUG', '-o', '-xyz']); program.should.have.property('cflags', '-DDEBUG'); program.should.have.property('other'); program.should.have.property('xother'); program.should.have.property('yother'); program.should.have.property('zother'); commander.js-2.20.0/test/test.options.coercion.js000066400000000000000000000020141345100027400217320ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); function parseRange(str) { return str.split('..').map(Number); } function increaseVerbosity(v, total) { return total + 1; } function collectValues(str, memo) { memo.push(str); return memo; } program .version('0.0.1') .option('-i, --int ', 'pass an int', parseInt) .option('-n, --num ', 'pass a number', Number) .option('-f, --float ', 'pass a float', parseFloat) .option('-r, --range ', 'pass a range', parseRange) .option('-v, --verbose', 'increase verbosity', increaseVerbosity, 0) .option('-c, --collect ', 'add a string (can be used multiple times)', collectValues, []); program.parse('node test -i 5.5 -f 5.5 -n 15.99 -r 1..5 -c foo -c bar -c baz -vvvv --verbose'.split(' ')); program.int.should.equal(5); program.num.should.equal(15.99); program.float.should.equal(5.5); program.range.should.eql([1, 5]); program.collect.should.eql(['foo', 'bar', 'baz']); program.verbose.should.equal(5); commander.js-2.20.0/test/test.options.commands.js000066400000000000000000000076471345100027400217530ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-C, --chdir ', 'change the working directory') .option('-c, --config ', 'set config path. defaults to ./deploy.conf') .option('-T, --no-tests', 'ignore test hook') var envValue = ""; var cmdValue = ""; var customHelp = false; program .command('setup [env]') .description('run setup commands for all envs') .option("-s, --setup_mode [mode]", "Which setup mode to use") .option("-o, --host [host]", "Host to use") .action(function (env, options) { var mode = options.setup_mode || "normal"; env = env || 'all'; envValue = env; }); program .command('exec ') .alias('ex') .description('execute the given remote cmd') .option("-e, --exec_mode ", "Which exec mode to use") .option("-t, --target [target]", "Target to use") .action(function (cmd, options) { cmdValue = cmd; }).on("--help", function () { customHelp = true; }); program .command('*') .action(function (env) { console.log('deploying "%s"', env); }); program.parse(['node', 'test', '--config', 'conf']); program.config.should.equal("conf"); program.commands[0].should.not.have.property('setup_mode'); program.commands[1].should.not.have.property('exec_mode'); envValue.should.equal(""); cmdValue.should.equal(""); program.parse(['node', 'test', '--config', 'conf1', 'setup', '--setup_mode', 'mode2', 'env1']); program.config.should.equal("conf1"); program.commands[0].setup_mode.should.equal("mode2"); program.commands[0].should.not.have.property('host'); envValue.should.equal("env1"); program.parse(['node', 'test', '--config', 'conf2', 'setup', '--setup_mode', 'mode3', '-o', 'host1', 'env2']); program.config.should.equal("conf2"); program.commands[0].setup_mode.should.equal("mode3"); program.commands[0].host.should.equal("host1"); envValue.should.equal("env2"); program.parse(['node', 'test', '--config', 'conf3', 'setup', '-s', 'mode4', 'env3']); program.config.should.equal("conf3"); program.commands[0].setup_mode.should.equal("mode4"); envValue.should.equal("env3"); program.parse(['node', 'test', '--config', 'conf4', 'exec', '--exec_mode', 'mode1', 'exec1']); program.config.should.equal("conf4"); program.commands[1].exec_mode.should.equal("mode1"); program.commands[1].should.not.have.property('target'); cmdValue.should.equal("exec1"); program.parse(['node', 'test', '--config', 'conf5', 'exec', '-e', 'mode2', 'exec2']); program.config.should.equal("conf5"); program.commands[1].exec_mode.should.equal("mode2"); cmdValue.should.equal("exec2"); program.parse(['node', 'test', '--config', 'conf6', 'exec', '--target', 'target1', '-e', 'mode6', 'exec3']); program.config.should.equal("conf6"); program.commands[1].exec_mode.should.equal("mode6"); program.commands[1].target.should.equal("target1"); cmdValue.should.equal("exec3"); delete program.commands[1].target; program.parse(['node', 'test', '--config', 'conf7', 'ex', '-e', 'mode3', 'exec4']); program.config.should.equal("conf7"); program.commands[1].exec_mode.should.equal("mode3"); program.commands[1].should.not.have.property('target'); cmdValue.should.equal("exec4"); // Make sure we still catch errors with required values for options var exceptionOccurred = false; var oldProcessExit = process.exit; var oldConsoleError = console.error; process.exit = function () { exceptionOccurred = true; throw new Error(); }; console.error = function () { }; var oldProcessStdoutWrite = process.stdout.write; process.stdout.write = function () { }; try { program.parse(['node', 'test', '--config', 'conf6', 'exec', '--help']); } catch (ex) { program.config.should.equal("conf6"); } process.stdout.write = oldProcessStdoutWrite; try { program.parse(['node', 'test', '--config', 'conf', 'exec', '-t', 'target1', 'exec1', '-e']); } catch (ex) { } process.exit = oldProcessExit; exceptionOccurred.should.be.true(); customHelp.should.be.true(); commander.js-2.20.0/test/test.options.defaults.given.js000066400000000000000000000016461345100027400230610ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-a, --anchovies', 'Add anchovies?') .option('-o, --onions', 'Add onions?', true) .option('-v, --olives', 'Add olives? Sorry we only have black.', 'black') .option('-s, --no-sauce', 'Uh… okay') .option('-r, --crust ', 'What kind of crust would you like?', 'hand-tossed') .option('-c, --cheese [type]', 'optionally specify the type of cheese', 'mozzarella'); program.parse(['node', 'test', '--anchovies', '--onions', '--olives', '--no-sauce', '--crust', 'thin', '--cheese', 'wensleydale']); program.should.have.property('anchovies', true); program.should.have.property('onions', true); program.should.have.property('olives', 'black'); program.should.have.property('sauce', false); program.should.have.property('crust', 'thin'); program.should.have.property('cheese', 'wensleydale'); commander.js-2.20.0/test/test.options.defaults.js000066400000000000000000000016321345100027400217450ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-a, --anchovies', 'Add anchovies?') .option('-o, --onions', 'Add onions?', true) .option('-v, --olives', 'Add olives? Sorry we only have black.', 'black') .option('-s, --no-sauce', 'Uh… okay') .option('-r, --crust ', 'What kind of crust would you like?', 'hand-tossed') .option('-c, --cheese [type]', 'optionally specify the type of cheese', 'mozzarella'); program.should.have.property('_name', ''); program.parse(['node', 'test']); program.should.have.property('_name', 'test'); program.should.not.have.property('anchovies'); program.should.not.have.property('onions'); program.should.not.have.property('olives'); program.should.have.property('sauce', true); program.should.have.property('crust', 'hand-tossed'); program.should.have.property('cheese', 'mozzarella'); commander.js-2.20.0/test/test.options.equals.js000066400000000000000000000007211345100027400214260ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('--string ', 'pass a string') .option('--string2 ', 'pass another string') .option('--num ', 'pass a number', Number) program.parse('node test --string=Hello --string2 Hello=World --num=5.5'.split(' ')); program.string.should.equal('Hello'); program.string2.should.equal('Hello=World'); program.num.should.equal(5.5); commander.js-2.20.0/test/test.options.func.js000066400000000000000000000013311345100027400210650ustar00rootroot00000000000000var program = require('../') , should = require('should'); program .version('0.0.1') .description('sdfdsfsfsdfdsf') .option('-f, --foo', 'add some foo') .option('-b, --bar', 'add some bar') .option('-M, --no-magic', 'disable magic') .option('-c, --camel-case', 'convert to camelCase') .option('-q, --quux ', 'add some quux'); program.parse(['node', 'test', '--foo', '--bar', '--no-magic', '--camel-case', '--quux', 'value']); program.opts.should.be.a.Function(); var opts = program.opts(); opts.should.be.an.Object(); opts.version.should.equal('0.0.1'); opts.foo.should.be.true(); opts.bar.should.be.true(); opts.magic.should.be.false(); opts.camelCase.should.be.true(); opts.quux.should.equal('value'); commander.js-2.20.0/test/test.options.hyphen.js000066400000000000000000000010201345100027400214200ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-a, --alpha ', 'hyphen') .option('-b, --bravo ', 'hyphen') .option('-c, --charlie ', 'hyphen') program.parse('node test -a - --bravo - --charlie=- - -- - -t1'.split(' ')); program.alpha.should.equal('-'); program.bravo.should.equal('-'); program.charlie.should.equal('-'); program.args[0].should.equal('-'); program.args[1].should.equal('-'); program.args[2].should.equal('-t1'); commander.js-2.20.0/test/test.options.large-only-with-value.js000066400000000000000000000004461345100027400242740ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('--longflag [value]', 'A long only flag with a value'); program.parse(['node', 'test', '--longflag', 'something']); program.longflag.should.equal('something'); commander.js-2.20.0/test/test.options.large-only.js000066400000000000000000000003601345100027400222040ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('--verbose', 'do stuff'); program.parse(['node', 'test', '--verbose']); program.verbose.should.be.true(); commander.js-2.20.0/test/test.options.regex.js000066400000000000000000000006201345100027400212440ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should'); program .version('0.0.1') .option('-s, --size ', 'Pizza Size', /^(large|medium|small)$/i, 'medium') .option('-d, --drink [drink]', 'Drink', /^(Coke|Pepsi|Izze)$/i) program.parse('node test -s big -d coke'.split(' ')); program.size.should.equal('medium'); program.drink.should.equal('coke'); commander.js-2.20.0/test/test.options.version.custom.js000066400000000000000000000012721345100027400231340ustar00rootroot00000000000000var program = require('../') , should = require('should'); var capturedExitCode, capturedOutput, oldProcessExit, oldProcessStdoutWrite; program.version('0.0.1', '-r, --revision'); ['-r', '--revision'].forEach(function (flag) { capturedExitCode = -1; capturedOutput = ''; oldProcessExit = process.exit; oldProcessStdoutWrite = process.stdout.write; process.exit = function (code) { capturedExitCode = code; } process.stdout.write = function(output) { capturedOutput += output; } program.parse(['node', 'test', flag]); process.exit = oldProcessExit; process.stdout.write = oldProcessStdoutWrite; capturedOutput.should.equal('0.0.1\n'); capturedExitCode.should.equal(0); }) commander.js-2.20.0/test/test.options.version.js000066400000000000000000000012471345100027400216250ustar00rootroot00000000000000var program = require('../') , should = require('should'); var capturedExitCode, capturedOutput, oldProcessExit, oldProcessStdoutWrite; program.version('0.0.1'); ['-V', '--version'].forEach(function (flag) { capturedExitCode = -1; capturedOutput = ''; oldProcessExit = process.exit; oldProcessStdoutWrite = process.stdout.write; process.exit = function (code) { capturedExitCode = code; } process.stdout.write = function(output) { capturedOutput += output; } program.parse(['node', 'test', flag]); process.exit = oldProcessExit; process.stdout.write = oldProcessStdoutWrite; capturedOutput.should.equal('0.0.1\n'); capturedExitCode.should.equal(0); }) commander.js-2.20.0/test/test.variadic.args.js000066400000000000000000000026101345100027400211560ustar00rootroot00000000000000/** * Module dependencies. */ var program = require('../') , should = require('should') , util = require('util') , programArgs = ['node', 'test', 'mycommand', 'arg0', 'arg1', 'arg2', 'arg3'] , requiredArg , variadicArg; program .version('0.0.1') .command('mycommand [variadicArg...]') .action(function (arg0, arg1) { requiredArg = arg0; variadicArg = arg1; }); program.parse(programArgs); requiredArg.should.eql('arg0'); variadicArg.should.eql(['arg1', 'arg2', 'arg3']); program.args.should.have.lengthOf(3); program.args[0].should.eql('arg0'); program.args[1].should.eql(['arg1', 'arg2', 'arg3']); program .version('0.0.1') .command('mycommand [optionalArg]') .action(function (arg0, arg1) { }); // Make sure we still catch errors with required values for options var consoleErrors = []; var oldProcessExit = process.exit; var oldConsoleError = console.error; var errorMessage; process.exit = function () { throw new Error(consoleErrors.join('\n')); }; console.error = function () { consoleErrors.push(util.format.apply(util, arguments)); }; try { program.parse(programArgs); should.fail(null, null, 'An Error should had been thrown above'); } catch (err) { errorMessage = err.message; } process.exit = oldProcessExit; console.error = oldConsoleError; 'error: variadic arguments must be last `variadicArg\''.should.eql(errorMessage); commander.js-2.20.0/tsconfig.json000066400000000000000000000006431345100027400166610ustar00rootroot00000000000000{ "compilerOptions": { "module": "commonjs", "lib": [ "es6" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, "types": [ "node" ], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "typings/index.d.ts", "typings/commander-tests.ts" ] }commander.js-2.20.0/typings/000077500000000000000000000000001345100027400156445ustar00rootroot00000000000000commander.js-2.20.0/typings/commander-tests.ts000066400000000000000000000054121345100027400213230ustar00rootroot00000000000000import * as program from './index'; interface ExtendedOptions extends program.CommandOptions { isNew: any; } const commandInstance = new program.Command('-f'); const optionsInstance = new program.Option('-f'); const name = program.name(); program .name('set name') .version('0.0.1') .option('-p, --peppers', 'Add peppers') .option('-P, --pineapple', 'Add pineapple') .option('-b, --bbq', 'Add bbq sauce') .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') .parse(process.argv); console.log('you ordered a pizza with:'); if (program['peppers']) console.log(' - peppers'); if (program['pineapple']) console.log(' - pineapple'); if (program['bbq']) console.log(' - bbq'); console.log(' - %s cheese', program['cheese']); function range(val: string) { return val.split('..').map(Number); } function list(val: string) { return val.split(','); } function collect(val: string, memo: string[]) { memo.push(val); return memo; } function increaseVerbosity(v: any, total: number) { return total + 1; } program .version('0.0.1') .usage('[options] ') .option('-i, --integer ', 'An integer argument', parseInt) .option('-f, --float ', 'A float argument', parseFloat) .option('-r, --range ..', 'A range', range) .option('-l, --list ', 'A list', list) .option('-o, --optional [value]', 'An optional value') .option('-c, --collect [value]', 'A repeatable value', collect, []) .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0) .parse(process.argv); console.log(' int: %j', program['integer']); console.log(' float: %j', program['float']); console.log(' optional: %j', program['optional']); program['range'] = program['range'] || []; console.log(' range: %j..%j', program['range'][0], program['range'][1]); console.log(' list: %j', program['list']); console.log(' collect: %j', program['collect']); console.log(' verbosity: %j', program['verbose']); console.log(' args: %j', program['args']); program .version('0.0.1') .option('-f, --foo', 'enable some foo') .option('-b, --bar', 'enable some bar') .option('-B, --baz', 'enable some baz'); // must be before .parse() since // node's emit() is immediate program.on('--help', () => { console.log(' Examples:'); console.log(''); console.log(' $ custom-help --help'); console.log(' $ custom-help -h'); console.log(''); }); program .command('allow-unknown-option') .allowUnknownOption() .action(() => { console.log('unknown option is allowed'); }); program .version('0.0.1') .arguments(' [env]') .action((cmd, env) => { console.log(cmd, env); }); program.parse(process.argv); console.log('stuff');commander.js-2.20.0/typings/index.d.ts000066400000000000000000000204741345100027400175540ustar00rootroot00000000000000// Type definitions for commander 2.11 // Project: https://github.com/visionmedia/commander.js // Definitions by: Alan Agius , Marcelo Dezem , vvakame , Jules Randolph // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace local { class Option { flags: string; required: boolean; optional: boolean; bool: boolean; short?: string; long: string; description: string; /** * Initialize a new `Option` with the given `flags` and `description`. * * @param {string} flags * @param {string} [description] */ constructor(flags: string, description?: string); } class Command extends NodeJS.EventEmitter { [key: string]: any; args: string[]; /** * Initialize a new `Command`. * * @param {string} [name] */ constructor(name?: string); /** * Set the program version to `str`. * * This method auto-registers the "-V, --version" flag * which will print the version number when passed. * * @param {string} str * @param {string} [flags] * @returns {Command} for chaining */ version(str: string, flags?: string): Command; /** * Add command `name`. * * The `.action()` callback is invoked when the * command `name` is specified via __ARGV__, * and the remaining arguments are applied to the * function for access. * * When the `name` is "*" an un-matched command * will be passed as the first arg, followed by * the rest of __ARGV__ remaining. * * @example * program * .version('0.0.1') * .option('-C, --chdir ', 'change the working directory') * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') * .option('-T, --no-tests', 'ignore test hook') * * program * .command('setup') * .description('run remote setup commands') * .action(function() { * console.log('setup'); * }); * * program * .command('exec ') * .description('run the given remote command') * .action(function(cmd) { * console.log('exec "%s"', cmd); * }); * * program * .command('teardown [otherDirs...]') * .description('run teardown commands') * .action(function(dir, otherDirs) { * console.log('dir "%s"', dir); * if (otherDirs) { * otherDirs.forEach(function (oDir) { * console.log('dir "%s"', oDir); * }); * } * }); * * program * .command('*') * .description('deploy the given env') * .action(function(env) { * console.log('deploying "%s"', env); * }); * * program.parse(process.argv); * * @param {string} name * @param {string} [desc] for git-style sub-commands * @param {CommandOptions} [opts] command options * @returns {Command} the new command */ command(name: string, desc?: string, opts?: commander.CommandOptions): Command; /** * Define argument syntax for the top-level command. * * @param {string} desc * @returns {Command} for chaining */ arguments(desc: string): Command; /** * Parse expected `args`. * * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. * * @param {string[]} args * @returns {Command} for chaining */ parseExpectedArgs(args: string[]): Command; /** * Register callback `fn` for the command. * * @example * program * .command('help') * .description('display verbose help') * .action(function() { * // output help here * }); * * @param {(...args: any[]) => void} fn * @returns {Command} for chaining */ action(fn: (...args: any[]) => void): Command; /** * Define option with `flags`, `description` and optional * coercion `fn`. * * The `flags` string should contain both the short and long flags, * separated by comma, a pipe or space. The following are all valid * all will output this way when `--help` is used. * * "-p, --pepper" * "-p|--pepper" * "-p --pepper" * * @example * // simple boolean defaulting to false * program.option('-p, --pepper', 'add pepper'); * * --pepper * program.pepper * // => Boolean * * // simple boolean defaulting to true * program.option('-C, --no-cheese', 'remove cheese'); * * program.cheese * // => true * * --no-cheese * program.cheese * // => false * * // required argument * program.option('-C, --chdir ', 'change the working directory'); * * --chdir /tmp * program.chdir * // => "/tmp" * * // optional argument * program.option('-c, --cheese [type]', 'add cheese [marble]'); * * @param {string} flags * @param {string} [description] * @param {((arg1: any, arg2: any) => void) | RegExp} [fn] function or default * @param {*} [defaultValue] * @returns {Command} for chaining */ option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command; option(flags: string, description?: string, defaultValue?: any): Command; /** * Allow unknown options on the command line. * * @param {boolean} [arg] if `true` or omitted, no error will be thrown for unknown options. * @returns {Command} for chaining */ allowUnknownOption(arg?: boolean): Command; /** * Parse `argv`, settings options and invoking commands when defined. * * @param {string[]} argv * @returns {Command} for chaining */ parse(argv: string[]): Command; /** * Parse options from `argv` returning `argv` void of these options. * * @param {string[]} argv * @returns {ParseOptionsResult} */ parseOptions(argv: string[]): commander.ParseOptionsResult; /** * Return an object containing options as key-value pairs * * @returns {{[key: string]: any}} */ opts(): { [key: string]: any }; /** * Set the description to `str`. * * @param {string} str * @param {{[argName: string]: string}} argsDescription * @return {(Command | string)} */ description(str: string, argsDescription?: {[argName: string]: string}): Command; description(): string; /** * Set an alias for the command. * * @param {string} alias * @return {(Command | string)} */ alias(alias: string): Command; alias(): string; /** * Set or get the command usage. * * @param {string} str * @return {(Command | string)} */ usage(str: string): Command; usage(): string; /** * Set the name of the command. * * @param {string} str * @return {Command} */ name(str: string): Command; /** * Get the name of the command. * * @return {string} */ name(): string; /** * Output help information for this command. * * @param {(str: string) => string} [cb] */ outputHelp(cb?: (str: string) => string): void; /** Output help information and exit. * * @param {(str: string) => string} [cb] */ help(cb?: (str: string) => string): never; } } declare namespace commander { type Command = local.Command type Option = local.Option interface CommandOptions { noHelp?: boolean; isDefault?: boolean; } interface ParseOptionsResult { args: string[]; unknown: string[]; } interface CommanderStatic extends Command { Command: typeof local.Command; Option: typeof local.Option; CommandOptions: CommandOptions; ParseOptionsResult: ParseOptionsResult; } } declare const commander: commander.CommanderStatic; export = commander;