Comparing version 1.2.3 to 2.0.0
@@ -6,4 +6,5 @@ { | ||
"author": "Roman Dvornov <rdvornov@gmail.com>", | ||
"repository": "lahmatiy/clap", | ||
"license": "MIT", | ||
"version": "1.2.3", | ||
"version": "2.0.0", | ||
"keywords": [ | ||
@@ -16,23 +17,26 @@ "cli", | ||
], | ||
"homepage": "https://github.com/lahmatiy/clap", | ||
"repository": "lahmatiy/clap", | ||
"main": "index.js", | ||
"main": "lib/index.js", | ||
"files": [ | ||
"index.js", | ||
"HISTORY.md", | ||
"LICENSE", | ||
"README.md" | ||
"lib" | ||
], | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"node": ">=8.0.0" | ||
}, | ||
"dependencies": { | ||
"chalk": "^1.1.3" | ||
"chalk": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.4.5" | ||
"coveralls": "^3.0.7", | ||
"eslint": "^6.5.1", | ||
"mocha": "^6.2.2", | ||
"nyc": "^14.1.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha test -R spec" | ||
"lint": "eslint lib test", | ||
"lint-and-test": "npm run lint && npm test", | ||
"test": "mocha -R progress", | ||
"coverage": "nyc npm test", | ||
"travis": "nyc npm run lint-and-test && npm run coveralls", | ||
"coveralls": "nyc report --reporter=text-lcov | coveralls" | ||
} | ||
} |
[![NPM version](https://img.shields.io/npm/v/clap.svg)](https://www.npmjs.com/package/clap) | ||
[![Dependency Status](https://img.shields.io/david/lahmatiy/clap.svg)](https://david-dm.org/lahmatiy/clap) | ||
[![Build Status](https://travis-ci.org/lahmatiy/clap.svg?branch=master)](https://travis-ci.org/lahmatiy/clap) | ||
[![Coverage Status](https://coveralls.io/repos/github/lahmatiy/clap/badge.svg?branch=master)](https://coveralls.io/github/lahmatiy/clap?branch=master) | ||
@@ -9,4 +9,44 @@ # Clap.js | ||
Inspired by TJ Holowaychuk [Commander](https://github.com/visionmedia/commander.js). | ||
## Usage | ||
[TODO: Complete readme] | ||
``` | ||
npm install clap | ||
``` | ||
```js | ||
const cli = require('clap'); | ||
const myCommand = cli.command('my-command', '[optional-arg]') | ||
.description('Optional description') | ||
.version('1.2.3') | ||
.option('-b, --bool', 'Bollean option') | ||
.option('--foo <foo>', 'Option with required argument') | ||
.option('--bar [bar]', 'Option with optional argument') | ||
.option('--baz [value]', 'Option with optional argument and normalize function', function(value) { | ||
// calls on init and for any value set | ||
return Number(value); | ||
}, 123) // 123 is default | ||
.action(function(args, literalArgs) { | ||
// args goes before options | ||
// literal args goes after -- | ||
// this.values is an object with collected values | ||
}); | ||
myCommand.run(); // runs with process.argv.slice(2) | ||
myCommand.run(['--foo', '123', '-b']) | ||
// sub-commands | ||
myCommand | ||
.command('nested') | ||
.option('-q, --quz', 'Some parameter', 'Default value') | ||
// ... | ||
.end() | ||
.command('another-command') | ||
// ... | ||
.command('level3-command') | ||
//... | ||
``` | ||
## License | ||
MIT |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29929
11
52
4
735
1
1
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
Updatedchalk@^3.0.0