Comparing version 4.2.4 to 4.3.0
{ | ||
"name": "cac", | ||
"version": "4.2.4", | ||
"version": "4.3.0", | ||
"description": "Command-line queen.", | ||
@@ -9,5 +9,6 @@ "repository": { | ||
}, | ||
"main": "dist/cac.common.js", | ||
"main": "dist/cac.js", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"index.d.ts" | ||
], | ||
@@ -23,6 +24,9 @@ "keywords": [ | ||
], | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "npm run lint && ava", | ||
"lint": "xo", | ||
"build": "bili --buble.target.node 4", | ||
"build": "bili --buble.target.node 6 --filename cac.js", | ||
"prepublish": "npm run build", | ||
@@ -46,3 +50,3 @@ "toc": "markdown-toc -i README.md" | ||
"babel-register": "^6.24.1", | ||
"bili": "^0.17.3", | ||
"bili": "^1.1.0", | ||
"eslint-config-rem": "^3.0.0", | ||
@@ -49,0 +53,0 @@ "markdown-toc": "^1.1.0", |
@@ -21,3 +21,2 @@ <img width="945" alt="2017-07-26 9 27 05" src="https://user-images.githubusercontent.com/8784712/28623641-373450f4-7249-11e7-854d-1b076dab274d.png"> | ||
- [Usage](#usage) | ||
* [No-command app](#no-command-app) | ||
- [Friends](#friends) | ||
@@ -36,5 +35,6 @@ - [Documentation](#documentation) | ||
+ [parsed](#parsed) | ||
+ [executed](#executed) | ||
- [Plugins](#plugins) | ||
- [FAQ](#faq) | ||
* [Why not `commander.js` `yargs` `caporal.js` or `meow`?](#why-not-commanderjs-yargs-caporaljs-or-meow) | ||
* [Why not `commander.js` `yargs` `caporal.js` or `meow` ?](#why-not-commanderjs-yargs-caporaljs-or-meow-) | ||
* [How is the name written and pronounced?](#how-is-the-name-written-and-pronounced) | ||
@@ -87,24 +87,2 @@ - [Contributing](#contributing) | ||
### No-command app | ||
In many cases your app is small and doesn't even need a *command*: | ||
```js | ||
const cli = require('cac')() | ||
// Use default command symbol '*' | ||
cli.command('*', option, runMyApp) | ||
cli.parse() | ||
``` | ||
Instead of using a default command, you can skip adding and running command by: | ||
```js | ||
const cli = require('cac')() | ||
// cli.argv is a getter | ||
// bascially it's the return value of cli.parse(null, { run: false }) | ||
const { input, flags } = cli.argv | ||
runMyApp(input, flags) | ||
``` | ||
## Friends | ||
@@ -132,2 +110,4 @@ | ||
- default: `any` option default value | ||
- required: `boolean` mark option as required | ||
- choices: `Array<any>` limit valid values for the option | ||
@@ -140,2 +120,3 @@ ### cli.command(name, [option], [handler]) | ||
- alias: `string` `Array<string>` command name alias | ||
- examples: `Array<string>` command examples | ||
- handler: `function` command handler | ||
@@ -190,2 +171,12 @@ - input: `Array<string>` cli arguments | ||
### cli.extraHelp(help) | ||
Add extra help messages to the bottom of help. | ||
#### help | ||
Type: `string` `object` | ||
The `help` could be a `string` or in `{ title, body }` format. | ||
### Events | ||
@@ -224,6 +215,2 @@ | ||
## Plugins | ||
- [required-option](https://github.com/cacjs/required-option) - Mark an option as required for specific command. | ||
## FAQ | ||
@@ -230,0 +217,0 @@ |
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
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
21307
5
370
252
1