{"bugs":{"url":"https://github.com/enquirer/enquirer/issues"},"dist":{"shasum":"d4601d1ca85ec25db4dc7873e952898294266c6e","tarball":"https://registry.npmjs.org/enquirer/-/enquirer-2.0.0.tgz","fileCount":36,"integrity":"sha512-UcURxxeBU09w0DRt7bgWObL53vH7r/lblqCwwdWkzmM5nEuo8Z5UEC3AblqdwO8RbWeOdcrz0vpR5AvDMPfb3g==","signatures":[{"sig":"MEUCIQC98Xn5B/L/poxkHCAlfuaeRV68ZY4E6i2bQK2JMJVCJgIgCF8Z8EidVBz3TDhZsWfBbAup0UXj6gq7qRgH9fvZVAY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2IYoCRA9TVsSAnZWagAAmLUQAIzT+7W7R0t6Ypy1ENM4\nkxpwOEHs7XVwM0iW3C23cmz891iTbqtbFVyzcpauTHK4WHlYhefBMWQbBhUl\nHEmIzPOXNac7A2sHvH5L82w/ndNocn5zdDfH5Kvncan78T2cMBV9Tr/KaVAT\n+DjLN/aQeAVnniXjHIbAQJP+CF6m3vCrrVF8SrhATm9JmUW+mScHDyvwzbVL\nT4K7N+ZB327473DeFok8z5+z8JvFTy/PUc71Umca8La3ZW0Iy7CP2MloOqMy\nrUXPUpn9IqVXzDtHt3BTkQxoLUG1Xn6nFJZgsXHX2miV3NNOFFDw7JFmznEb\noxHVUUeOAxUCWI5FpJpssBbC0aCaKiHNgKHSBVDt+cZmthgdMRbcS/oqW8hl\nLsNkLWw6GoTj77WRM/0+H46q3XoowdHNRTnsskh1iu2uhRbD+MwFEB+oF3mo\nTKtC4ZT24vhaEhso5yiPHKOWhyzjLvcQ5sqFseY9F6JGiVAfm0KmubxUJGse\n5mjK5PKiaWvp5ukMTQRpSTr0Dw7GRghOgb03ygqX9WRvGcWIDxqXrwdAvHgg\nrFuayJhbT0FZyBKEuZaXE4RvEEszziXKFH/piNsd1ZkAD/YCY1twTn/pEUoE\nz+E+yKWa/pCwc2OlXHFZtoMAS4Rzag6tv65QVLKZRIGZhNstUFmavbOmJJL3\n1dnI\r\n=/f1h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","name":"enquirer","verb":{"toc":false,"lint":{"reflinks":true},"tasks":["readme"],"layout":"common-minimal","plugins":["gulp-format-md"],"reflinks":["inquirer","prompt-skeleton"]},"author":{"url":"https://github.com/jonschlinkert","name":"Jon Schlinkert"},"readme":"# enquirer [![NPM version](https://img.shields.io/npm/v/enquirer.svg?style=flat)](https://www.npmjs.com/package/enquirer) [![NPM monthly downloads](https://img.shields.io/npm/dm/enquirer.svg?style=flat)](https://npmjs.org/package/enquirer) [![NPM total downloads](https://img.shields.io/npm/dt/enquirer.svg?style=flat)](https://npmjs.org/package/enquirer) [![Linux Build Status](https://img.shields.io/travis/enquirer/enquirer.svg?style=flat&label=Travis)](https://travis-ci.org/enquirer/enquirer)\n\n> Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n<h1 align=\"center\">Enquirer</h1>\n\n<br>\n<br>\n\n<p align=\"center\">\n<b>Stylish CLI prompts that are user-friendly, intuitive and easy to create.</b></br>\n<sub>>_ Prompts should be more like conversations than inquisitions▌<sub>\n</p>\n\n<br>\n<br>\n\nEnquirer is fast, easy to use, and lightweight enough for small projects, while also being powerful and customizable enough for the most advanced use cases.\n\n* **Fast** - [Loads in ~4ms](#performance) (that's about _3-4 times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps_)\n* **Lightweight** - Only [one dependency](https://github.com/doowb/ansi-colors).\n* **Easy to use** - Uses promises and async/await to make prompts easy to create and use.\n* **Intuitive** - Navigating around input and choices is a breeze. Advanced keypress combos are available to simplify usage. You can even [record and playback keypresses](recipes/play.js) to aid with tutorials and videos.\n* **Multilingual** - Easily add support for multiple languages.\n* **Extensible** - Prompts are easy to create and extend.\n* **Flexible** - All prompts can be used standalone or chained together.\n* **Pluggable** - Add advanced features to Enquirer with plugins.\n* **Stylish** - Easily override styles and symbols for any part of the prompt.\n* **Validation** - Optionally validate user input with any prompt.\n* **Well tested** - All prompts are well-tested, and tests are easy to create without having to use brittle, hacky solutions to spy on prompts or \"inject\" values.\n\n<br>\n<hr>\n<br>\n\n## ❯ Beta release!!!\n\nWe're extremely excited to announce that we've published Enquirer 2.0.0 as a beta release to [npm](https://www.npmjs.com/package/enquirer/v/beta). To use the beta version see the [installation instructions below](#-install).\n\nThis documentation is for the beta, which means we're still working on documenting everything, creating [examples](./examples), and having fun writing [recipes](./recipes) to demonstrate how [prompts](#prompt-api) can be extended and customized. If you'd like to contribute to any of these, please feel free to open an [issue](./issues/new) for discussion or [pull request](./pulls) with your changes. We are also looking for technical writers to help with writing more detailed user and developer documentation, tutorials, and blog posts about Enquirer 2 and all of the awesome features that are available.\n\n<br>\n<hr>\n<br>\n\n## ❯ Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save enquirer@beta\n```\n\n_(Requires Node.js 8.6 or higher. Please let us know if you need support for an earlier version by creating an [issue](../../issues/new).)_\n\n<br>\n<hr>\n<br>\n\n## ❯ Getting started\n\nGet started with Enquirer, the most powerful and easy-to-use Node.js library for creating interactive CLI prompts.\n\n* [Usage](#-usage)\n* [API](#-api)\n* [Options](#-options)\n* [Performance](#-performance)\n* [Credit](#-credit)\n\n<br>\n<hr>\n<br>\n\n## ❯ Usage\n\n### Single prompt\n\nPass a [question object](#prompt-options) to run a single prompt.\n\n```js\nconst { prompt } = require('enquirer');\n\nconst response = await prompt({\n  type: 'input',\n  name: 'username',\n  message: 'What is your username?' \n});\n\nconsole.log(response); \n//=> { username: 'jonschlinkert' }\n```\n\n_(Examples with `await` need to be run inside an `async` function)_\n\n### Multiple prompts\n\nPass an array of [\"question\" objects](#prompt-options) to run a series of prompts.\n\n```js\nconst response = await prompt([\n  {\n    type: 'input',\n    name: 'name',\n    message: 'What is your name?' \n  },\n  {\n    type: 'input',\n    name: 'username',\n    message: 'What is your username?' \n  }\n]);\n\nconsole.log(response);\n//=> { name: 'Edward Chan', username: 'edwardmchan' }\n```\n\n<br>\n<hr>\n<br>\n\n## ❯ API\n\n### [Enquirer](index.js#L19)\n\nCreate an instance of `Enquirer`.\n\n**Params**\n\n* `options` **{Object}**: (optional) Options to use with all prompts.\n* `answers` **{Object}**: (optional) Answers object to initialize with.\n\n**Example**\n\n```js\nconst Enquirer = require('enquirer');\nconst enquirer = new Enquirer();\n```\n\n### [register](index.js#L41)\n\nRegister a custom prompt type.\n\n**Params**\n\n* `type` **{String}**\n* `fn` **{Function|Prompt}**: `Prompt` class, or a function that returns a `Prompt` class.\n* `returns` **{Object}**: Returns the Enquirer instance\n\n**Example**\n\n```js\nconst Enquirer = require('enquirer');\nconst enquirer = new Enquirer();\nenquirer.register('customType', require('./custom-prompt'));\n```\n\n### [prompt](index.js#L79)\n\nPrompt function that takes a \"question\" object or array of question objects, and returns an object with responses from the user.\n\n**Params**\n\n* `questions` **{Array|Object}**: Options objects for one or more prompts to run.\n* `returns` **{Promise}**: Promise that returns an \"answers\" object with the user's responses.\n\n**Example**\n\n```js\nconst Enquirer = require('enquirer');\nconst enquirer = new Enquirer();\n\n(async() => {\n  const response = await enquirer.prompt({\n    type: 'input',\n    name: 'username',\n    message: 'What is your username?'\n  });\n  console.log(response);\n})();\n```\n\n### [use](index.js#L162)\n\nUse an enquirer plugin.\n\n**Params**\n\n* `plugin` **{Function}**: Plugin function that takes an instance of Enquirer.\n* `returns` **{Object}**: Returns the Enquirer instance.\n\n**Example**\n\n```js\nconst Enquirer = require('enquirer');\nconst enquirer = new Enquirer();\nconst plugin = enquirer => {\n  // do stuff to enquire instance\n};\nenquirer.use(plugin);\n```\n\n### [use](index.js#L184)\n\nProgrammatically cancel all prompts.\n\n**Params**\n\n* `plugin` **{Function}**: Plugin function that takes an instance of Enquirer.\n* `returns` **{Object}**: Returns the Enquirer instance.\n\n**Example**\n\n```js\nconst Enquirer = require('enquirer');\nconst enquirer = new Enquirer();\n\nenquirer.use(plugin);\n```\n\n### [Enquirer#prompt](index.js#L242)\n\nPrompt function that takes a \"question\" object or array of question objects, and returns an object with responses from the user.\n\n**Params**\n\n* `questions` **{Array|Object}**: Options objects for one or more prompts to run.\n* `returns` **{Promise}**: Promise that returns an \"answers\" object with the user's responses.\n\n**Example**\n\n```js\nconst { prompt } = require('enquirer');\n(async() => {\n  const response = await prompt({\n    type: 'input',\n    name: 'username',\n    message: 'What is your username?'\n  });\n  console.log(response);\n})();\n```\n\n## Prompt API\n\n<br>\n<hr>\n<br>\n\n## ❯ Options\n\n### Enquirer options\n\nTODO\n\n### Prompt options\n\nEach prompt takes an options object (aka \"question\" object), that implements the following interface:\n\n```js\n{\n  type: string | function,\n  name: string | function,\n  message: string | function | async function,\n  initial: string | function | async function\n  format: function | async function,\n  answer: function | async function,\n  validate: function | async function\n}\n```\n\n| **Property** | **Type** | **Description** |\n| --- | --- | --- |\n| `type` (required) | `string`, `function` | Enquirer uses this value to determine the type of prompt to run, but it's optional when prompts are run directly. |\n| `name` (required) | `string`, `function` | Used as the key for the answer on the returned values (answers) object. |\n| `message` (required) | `string`, `function` | The message to display when the prompt is rendered in the terminal. |\n| `initial` (optional) | `string`, `function` | The default value to return if the user does not supply a value. |\n| `format` (optional) | `function` | Function to format user input in the terminal. |\n| `result` (optional) | `function` | Function to format the final, submitted value before it's returned. |\n| `validate` (optional) | `function` | Function to validate the submitted value before it's returned. This function may return a boolean or a string. If a string is returned it will be used as the validation error message. |\n\n**Example**\n\n```js\nconst question = {\n  type: 'select',\n  name: 'color',\n  message: 'Favorite color?',\n  initial: 1,\n  choices: [\n    { name: 'red',   message: 'Red',   value: '#ff0000' },\n    { name: 'green', message: 'Green', value: '#00ff00' },\n    { name: 'blue',  message: 'Blue',  value: '#0000ff' }\n  ]\n};\n```\n\n### Choice objects\n\n```js\nChoice {\n  name: string;\n  message: string | undefined;\n  value: string | undefined;\n  hint: string | undefined;\n  disabled: boolean | string | undefined;\n  enabled: boolean | undefined;\n}\n```\n\n| **Property**  | **Type**   | **Description**  |\n| --- | --- | --- |\n| `name`        | `string`   | The unique id for a choice |\n| `message`     | `string`   | The message to display  |\n| `value`       | `string`   | The value to return if the choice is selected |\n| `alias`       | `string`   | Single character to use when keypress shortcuts are supported |\n| `hint`        | `string`   |  |\n| `error`       | `string`   |  |\n| `disabled`    | `boolean`  |  |\n| `separator`   | `boolean`  |  |\n| `selected`    | `boolean`  |  |\n\n## ❯ Performance\n\nMacBook Pro, Intel Core i7, 2.5 GHz, 16 GB.\n\n### Load time\n\nTime it takes for the module to load the first time (average of 3 runs):\n\n```\nenquirer: 4.013ms\ninquirer: 286.717ms\nprompts: 17.010ms\n```\n\n## ❯ Credit\n\nThanks to [derhuerst](https://github.com/derhuerst), creator of prompt libraries such as [prompt-skeleton](https://github.com/derhuerst/prompt-skeleton), which influenced some of the concepts we used in our prompts.\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 72 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 12 | [doowb](https://github.com/doowb) |  \n| 1  | [mischah](https://github.com/mischah) |  \n| 1  | [skellock](https://github.com/skellock) |  \n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on October 30, 2018._","engines":{"node":">=8.6"},"gitHead":"9cf052c1dccf40558ec6ee7a351cfa1bd680344f","license":"MIT","scripts":{"test":"mocha","cover":"nyc --reporter=text --reporter=html mocha"},"_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"homepage":"https://github.com/enquirer/enquirer","keywords":["answer","answers","ask","base","cli","command","command-line","enquirer","Enquirer","enquirerprompt","input","inquire","inquirer","interface","menu","prompt","prompts","question","readline","stdin","stdout","terminal","tty","ui"],"lintDeps":{"devDependencies":{"files":{"patterns":["examples/**/*.js","perf/*.js","recipes/*.js"]}}},"repository":{"url":"git+https://github.com/enquirer/enquirer.git","type":"git"},"_npmVersion":"6.4.1","description":"Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.","directories":{},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"_nodeVersion":"10.3.0","contributors":[{"url":"https://twitter.com/doowb","name":"Brian Woodward"},{"url":"http://twitter.com/jonschlinkert","name":"Jon Schlinkert"}],"dependencies":{"ansi-colors":"^3.2.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^12.0.2","mocha":"^5.2.0","yosay":"^2.0.2","semver":"^5.6.0","prompts":"^1.1.1","inquirer":"^6.2.0","data-store":"^3.1.0","cli-spinners":"^1.3.1","time-require":"github:jonschlinkert/time-require","gulp-format-md":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/enquirer_2.0.0_1540916775264_0.018395392008450973","host":"s3://npm-registry-packages"},"_id":"enquirer@2.0.0","version":"2.0.0"}