diff options
author | cjihrig <cjihrig@gmail.com> | 2018-06-22 23:05:00 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-06-24 12:43:54 -0400 |
commit | 7a3bbbf41be64d04058a158f6986ec5641885f42 (patch) | |
tree | 086e84227091cfc5dfa9eb729f007424cf51feb8 /tools/node_modules/eslint/node_modules/inquirer/README.md | |
parent | d5316bc27df87b62675adec517e5dd3108efd1c2 (diff) | |
download | android-node-v8-7a3bbbf41be64d04058a158f6986ec5641885f42.tar.gz android-node-v8-7a3bbbf41be64d04058a158f6986ec5641885f42.tar.bz2 android-node-v8-7a3bbbf41be64d04058a158f6986ec5641885f42.zip |
tools: update ESLint to 5.0.0
This is a new major release of ESLint.
PR-URL: https://github.com/nodejs/node/pull/20855
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'tools/node_modules/eslint/node_modules/inquirer/README.md')
-rw-r--r-- | tools/node_modules/eslint/node_modules/inquirer/README.md | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/tools/node_modules/eslint/node_modules/inquirer/README.md b/tools/node_modules/eslint/node_modules/inquirer/README.md index 56f65b5cb6..8989249d58 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/README.md +++ b/tools/node_modules/eslint/node_modules/inquirer/README.md @@ -5,6 +5,8 @@ Inquirer.js A collection of common interactive command line user interfaces. +**Version 4.x** only supports Node 6 and over. For Node 4 support please use [version 3.x](https://github.com/SBoudrias/Inquirer.js/tree/v3.3.0). + ## Table of Contents 1. [Documentation](#documentation) @@ -53,7 +55,7 @@ npm install inquirer ```javascript var inquirer = require('inquirer'); -inquirer.prompt([/* Pass your questions in here */]).then(function (answers) { +inquirer.prompt([/* Pass your questions in here */]).then(answers => { // Use user feedback for... whatever!! }); ``` @@ -111,17 +113,18 @@ A question object is a `hash` containing question related values: Array values can be simple `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash) and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator). - **validate**: (Function) Receive the user input and answers hash. Should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided. - **filter**: (Function) Receive the user input and return the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash. +- **transformer**: (Function) Receive the user input and answers hash, and return a transformed value to display to the user. The transformation only impacts what is shown while editing. It does not modify the answers hash. - **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean. - **pageSize**: (Number) Change the number of lines that will be rendered when using `list`, `rawList`, `expand` or `checkbox`. - **prefix**: (String) Change the default _prefix_ message. - **suffix**: (String) Change the default _suffix_ message. -`default`, `choices`(if defined as functions), `validate`, `filter` and `when` functions can be called asynchronous. Either return a promise or use `this.async()` to get a callback you'll call with the final value. +`default`, `choices`(if defined as functions), `validate`, `filter` and `when` functions can be called asynchronously. Either return a promise or use `this.async()` to get a callback you'll call with the final value. ``` javascript { /* Preferred way: with promise */ - filter: function () { + filter() { return new Promise(/* etc... */); }, @@ -131,7 +134,7 @@ Array values can be simple `strings`, or `objects` containing a `name` (to displ var done = this.async(); // Do async stuff - setTimeout(function () { + setTimeout(function() { if (typeof input !== 'number') { // Pass the return value in the done callback done('You need to provide a number'); @@ -186,16 +189,16 @@ Separator instances have a property `type` equal to `separator`. This should all Take `type`, `name`, `message`, `choices`[, `default`, `filter`] properties. (Note that default must be the choice `index` in the array or a choice `value`) -![List prompt](assets/screenshots/list-prompt.png) +![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg) --- #### Raw List - `{type: 'rawlist'}` Take `type`, `name`, `message`, `choices`[, `default`, `filter`] properties. (Note that -default must the choice `index` in the array) +default must be the choice `index` in the array) -![Raw list prompt](assets/screenshots/rawlist-prompt.png) +![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg) --- @@ -208,8 +211,8 @@ Note that the `choices` object will take an extra parameter called `key` for the See `examples/expand.js` for a running example. -![Expand prompt closed](assets/screenshots/expand-prompt-1.png) -![Expand prompt expanded](assets/screenshots/expand-prompt-2.png) +![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg) +![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg) --- @@ -221,7 +224,7 @@ Choices marked as `{checked: true}` will be checked by default. Choices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputted next to the disabled choice, otherwise it'll default to `"Disabled"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string. -![Checkbox prompt](assets/screenshots/checkbox-prompt.png) +![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg) --- @@ -229,15 +232,15 @@ Choices whose property `disabled` is truthy will be unselectable. If `disabled` Take `type`, `name`, `message`[, `default`] properties. `default` is expected to be a boolean if used. -![Confirm prompt](assets/screenshots/confirm-prompt.png) +![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg) --- #### Input - `{type: 'input'}` -Take `type`, `name`, `message`[, `default`, `filter`, `validate`] properties. +Take `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties. -![Input prompt](assets/screenshots/input-prompt.png) +![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg) --- @@ -245,7 +248,7 @@ Take `type`, `name`, `message`[, `default`, `filter`, `validate`] properties. Take `type`, `name`, `message`[, `default`, `filter`, `validate`] properties. -![Password prompt](assets/screenshots/password-prompt.png) +![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg) --- @@ -284,7 +287,7 @@ ui.updateBottomBar('new bottom bar content'); ## Reactive interface -Internally, Inquirer uses the [JS reactive extension](https://github.com/Reactive-Extensions/RxJS) to handle events and async flows. +Internally, Inquirer uses the [JS reactive extension](https://github.com/ReactiveX/rxjs) to handle events and async flows. This mean you can take advantage of this feature to provide more advanced flows. For example, you can dynamically add questions to be asked: @@ -293,11 +296,11 @@ var prompts = new Rx.Subject(); inquirer.prompt(prompts); // At some point in the future, push new questions -prompts.onNext({ /* question... */ }); -prompts.onNext({ /* question... */ }); +prompts.next({ /* question... */ }); +prompts.next({ /* question... */ }); // When you're done -prompts.onCompleted(); +prompts.complete(); ``` And using the return value `process` property, you can access more fine grained callbacks: @@ -366,6 +369,11 @@ Presents a list of options as the user types, compatible with other packages suc <br> ![autocomplete prompt](https://github.com/mokkabonna/inquirer-autocomplete-prompt/raw/master/inquirer.gif) +[__checkbox-plus__](https://github.com/faressoft/inquirer-checkbox-plus-prompt)<br> +Checkbox list with autocomplete and other additions<br> +<br> +![checkbox-plus](https://github.com/faressoft/inquirer-checkbox-plus-prompt/raw/master/demo.gif) + [__datetime__](https://github.com/DerekTBrown/inquirer-datepicker-prompt)<br> Customizable date/time selector using both number pad and arrow keys<br> <br> @@ -384,3 +392,6 @@ Simple prompt with command history and dynamic autocomplete Prompt for input chalk-pipe style strings<br> <br> ![inquirer-chalk-pipe](https://github.com/LitoMore/inquirer-chalk-pipe/raw/master/screenshot.gif) + +[__inquirer-search-checkbox__](https://github.com/clinyong/inquirer-search-checkbox)<br> +Searchable Inquirer checkbox<br> |