{"_id":"prompt-expand","_rev":"7-384a352d98158e38a591450e0e696530","name":"prompt-expand","description":"Expand prompt. Can be used as a standalone prompt, or with a prompt system like [Enquirer].","dist-tags":{"latest":"1.0.1"},"versions":{"0.1.0":{"name":"prompt-expand","description":"Expand prompt. Can be used as a standalone prompt, or with a prompt system like [Enquirer].","version":"0.1.0","homepage":"https://github.com/enquirer/prompt-expand","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/enquirer/prompt-expand.git"},"bugs":{"url":"https://github.com/enquirer/prompt-expand/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"log-utils":"^0.2.1","prompt-base":"^0.5.0","terminal-paginator":"^0.2.1"},"devDependencies":{"enquirer":"^0.3.1","gulp-format-md":"^0.1.11"},"keywords":["answer","answers","ask","checkbox","choice","cli","command","enquirer","enquirerprompt","expand","input","inquire","inquirer","interact","list","menu","password","prompt","prompts","question","readline","stdin","stdout","terminal","tty","ui"],"verb":{"toc":false,"layout":"common-minimal","data":{"alias":"expand"},"tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["enquirer","prompt-base","prompt-checkbox","prompt-confirm","prompt-radio"]},"reflinks":["enquirer","verb","verb-generate-readme"],"lint":{"reflinks":true}},"gitHead":"99bd973b092ecac11942caafc1a9409b4c2eeb2a","_id":"prompt-expand@0.1.0","_shasum":"a124bc511361ea2ea9929b0d846b7f1a113edf3c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.7.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"a124bc511361ea2ea9929b0d846b7f1a113edf3c","tarball":"https://registry.npmjs.org/prompt-expand/-/prompt-expand-0.1.0.tgz","integrity":"sha512-dlV8ODSTvdelNUnfhWzssSTkcy9aA9cvkCwyV4Wgc1zTvFQdSSEc84UYWn2qJNyHO/M0sD2dAUPi+4xcjHzmvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJRf3Jyc73SOKfNZyeUnWSWbJ1RG5OzDfD2DIiE++uuQIgF+aXdF57xRmGIcjorlRnVJUH67gv+mifOQXZqCCTk0w="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/prompt-expand-0.1.0.tgz_1476382907822_0.4617223625537008"},"directories":{}},"1.0.0":{"name":"prompt-expand","description":"Expand prompt. Can be used as a standalone prompt, or with a prompt system like [Enquirer].","version":"1.0.0","homepage":"https://github.com/enquirer/prompt-expand","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/enquirer/prompt-expand.git"},"bugs":{"url":"https://github.com/enquirer/prompt-expand/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"ansi-colors":"^0.2.0","prompt-rawlist":"^2.0.0"},"devDependencies":{"enquirer":"^0.4.1","gulp-format-md":"^0.1.12"},"keywords":["answer","answers","ask","checkbox","choice","cli","command","enquirer","enquirerprompt","expand","input","inquire","inquirer","interact","list","menu","password","prompt","prompts","question","readline","stdin","stdout","terminal","tty","ui"],"verb":{"toc":false,"layout":"common-minimal","data":{"alias":"expand"},"tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["enquirer","prompt-base","prompt-checkbox","prompt-confirm","prompt-radio"]},"lint":{"reflinks":true}},"gitHead":"33d1ab00bda74b9ce5396f55f9d178eef1764e3a","_id":"prompt-expand@1.0.0","_shasum":"5ccce63c6b82caedb640dd4bb6c30a6f3a6129e8","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"5ccce63c6b82caedb640dd4bb6c30a6f3a6129e8","tarball":"https://registry.npmjs.org/prompt-expand/-/prompt-expand-1.0.0.tgz","integrity":"sha512-TggnmNNoXzZfLh++kr9iotv3PJiMRk/w+8yZRcUbE15ltVOt2Sc1KueUuBPZHgEdc6PK1coyapHuT6z0OvJjOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBZnkrWIg9dqHQ5x0icHZbH01DMPleg8kylI8qi/i1fcAiAq9rlWfz6wx+ECSTMjuA8lTF3JM8n9NyZVvXpibHHp1A=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prompt-expand-1.0.0.tgz_1495919190559_0.3135150533635169"},"directories":{}},"1.0.1":{"name":"prompt-expand","description":"Expand prompt. Can be used as a standalone prompt, or with a prompt system like [Enquirer].","version":"1.0.1","homepage":"https://github.com/enquirer/prompt-expand","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/enquirer/prompt-expand.git"},"bugs":{"url":"https://github.com/enquirer/prompt-expand/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=6"},"scripts":{"test":"mocha"},"dependencies":{"ansi-colors":"^1.1.0","prompt-rawlist":"^2.0.1"},"devDependencies":{"enquirer":"^1.0.3","gulp-format-md":"^1.0.0"},"keywords":["answer","answers","ask","checkbox","choice","cli","command","enquirer","enquirerprompt","expand","input","inquire","inquirer","interact","list","menu","password","prompt","prompts","question","readline","stdin","stdout","terminal","tty","ui"],"verb":{"toc":false,"layout":"common-minimal","data":{"alias":"expand"},"tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["enquirer","prompt-base","prompt-checkbox","prompt-confirm","prompt-radio"]},"lint":{"reflinks":true}},"gitHead":"3b408dedcdb2430f6d754ceb91f650dc2876f975","_id":"prompt-expand@1.0.1","_npmVersion":"5.7.1","_nodeVersion":"9.7.1","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"integrity":"sha512-BDTw6tuWF6TuM1ZmwN5K/p6FCmm2E/QeQbtKoL76HrVdgjUQab9MQnIcWfTPh5d0NOO7Rf/Y1onvIQMkEw3Srg==","shasum":"f6916255147eea289bd05e5565c61d4133ff7a2e","tarball":"https://registry.npmjs.org/prompt-expand/-/prompt-expand-1.0.1.tgz","fileCount":4,"unpackedSize":12985,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAVIMNiIC28PxT1oeP+ZdAIQXz+8dYedUHMUFmqryJamAiEAsPQEo0tIxRWMblA/TpWjL2Ss1pArS+dAe0BFRZ1JTIM="}]},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prompt-expand_1.0.1_1521649371813_0.5921276891270018"},"_hasShrinkwrap":false}},"readme":"# prompt-expand [![NPM version](https://img.shields.io/npm/v/prompt-expand.svg?style=flat)](https://www.npmjs.com/package/prompt-expand) [![NPM monthly downloads](https://img.shields.io/npm/dm/prompt-expand.svg?style=flat)](https://npmjs.org/package/prompt-expand) [![NPM total downloads](https://img.shields.io/npm/dt/prompt-expand.svg?style=flat)](https://npmjs.org/package/prompt-expand)\n\n> Expand prompt. Can be used as a standalone prompt, or with a prompt system like [Enquirer](https://github.com/enquirer/enquirer).\n\n![prompt-expand example](https://raw.githubusercontent.com/enquirer/prompt-expand/master/example.gif)\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save prompt-expand\n```\n\n## Usage\n\n```js\nvar Prompt = require('prompt-expand');\nvar prompt = new Prompt({\n  message: 'What action should be taken on file.js?',\n  name: 'conflict',\n  default: 'x',\n  choices: [\n    {\n      key: 'y',\n      name: 'Overwrite',\n      value: 'overwrite'\n    },\n    {\n      key: 'a',\n      name: 'Overwrite this one and all next',\n      value: 'overwrite_all'\n    },\n    {\n      key: 'd',\n      name: 'Show diff',\n      value: 'diff'\n    },\n    new Prompt.Separator(),\n    {\n      key: 'x',\n      name: 'Abort',\n      value: 'abort'\n    }\n  ]\n});\n\n// async\nprompt.ask(function(answer) {\n  console.log({file: answer});\n});\n\n// promise\nprompt.run()\n  .then(function(answer) {\n    console.log({file: answer});\n  })\n  .catch(function(err) {\n    console.log(err);\n  });\n```\n\n## Enquirer usage\n\nRegister as a plugin with [enquirer](https://github.com/enquirer/enquirer).\n\n```js\nvar Enquirer = require('enquirer');\nvar enquirer = new Enquirer();\n\nenquirer.register('expand', require('prompt-expand'));\n```\n\n### Functional-style questions\n\nDefine questions using the `.question` method.\n\n```js\nenquirer.question('file', 'Conflict on `file.js`: ', {\n  type: 'expand',\n  // \"default\" can be the index of the default choice, \n  // or the `key` or `name` of the default choice\n  default: 'x', \n  choices: [\n    {\n      key: 'y',\n      name: 'Overwrite',\n      value: 'overwrite'\n    },\n    {\n      key: 'a',\n      name: 'Overwrite this one and all next',\n      value: 'overwrite_all'\n    },\n    {\n      key: 'd',\n      name: 'Show diff',\n      value: 'diff'\n    },\n    enquirer.separator(),\n    {\n      key: 'x',\n      name: 'Abort',\n      value: 'abort'\n    }\n  ]\n});\n\nenquirer.ask(questions)\n  .then(function(answers) {\n    console.log(answers);\n  })\n  .catch(function(err) {\n    console.log(err);\n  });\n```\n\n### Declarative-style questions\n\nDefine questions using a declarative, Inquirer-style format.\n\n```js\nvar questions = [\n  {\n    type: 'expand',\n    message: 'Conflict on `file.js`: ',\n    default: 'x',\n    name: 'file',\n    choices: [\n      {\n        key: 'y',\n        name: 'Overwrite',\n        value: 'overwrite'\n      },\n      {\n        key: 'a',\n        name: 'Overwrite this one and all next',\n        value: 'overwrite_all'\n      },\n      {\n        key: 'd',\n        name: 'Show diff',\n        value: 'diff'\n      },\n      enquirer.separator(),\n      {\n        key: 'x',\n        name: 'Abort',\n        value: 'abort'\n      }\n    ]\n  }\n];\n\nenquirer.ask(questions)\n  .then(function(answers) {\n    console.log(answers);\n  })\n  .catch(function(err) {\n    console.log(err);\n  });\n```\n\n## Attribution\n\nBased on the `expand` prompt in inquirer.\n\n## About\n\n### Related projects\n\n* [enquirer](https://www.npmjs.com/package/enquirer): Intuitive, plugin-based prompt system for node.js. Much faster and lighter alternative to Inquirer, with all… [more](https://github.com/enquirer/enquirer) | [homepage](https://github.com/enquirer/enquirer \"Intuitive, plugin-based prompt system for node.js. Much faster and lighter alternative to Inquirer, with all the same prompt types and more, but without the bloat.\")\n* [prompt-base](https://www.npmjs.com/package/prompt-base): Base prompt module used for creating custom prompts. | [homepage](https://github.com/enquirer/prompt-base \"Base prompt module used for creating custom prompts.\")\n* [prompt-checkbox](https://www.npmjs.com/package/prompt-checkbox): Multiple-choice/checkbox prompt. Can be used standalone or with a prompt system like [Enquirer](https://github.com/enquirer/enquirer). | [homepage](https://github.com/enquirer/prompt-checkbox \"Multiple-choice/checkbox prompt. Can be used standalone or with a prompt system like [Enquirer].\")\n* [prompt-confirm](https://www.npmjs.com/package/prompt-confirm): Confirm (yes/no) prompt. Can be used standalone or with a prompt system like [Enquirer](https://github.com/enquirer/enquirer). | [homepage](https://github.com/enquirer/prompt-confirm \"Confirm (yes/no) prompt. Can be used standalone or with a prompt system like [Enquirer].\")\n* [prompt-radio](https://www.npmjs.com/package/prompt-radio): Radio prompt. This prompt behaves like other radio-button interfaces, where only one choice is enabled… [more](https://github.com/enquirer/prompt-radio) | [homepage](https://github.com/enquirer/prompt-radio \"Radio prompt. This prompt behaves like other radio-button interfaces, where only one choice is enabled whilst all others are disabled. Can be used as a standalone prompt, or with a prompt system like [Enquirer].\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Running tests\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### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [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.6.0, on May 27, 2017._","maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2022-06-24T19:53:09.067Z","created":"2016-10-13T18:21:49.527Z","0.1.0":"2016-10-13T18:21:49.527Z","1.0.0":"2017-05-27T21:06:31.548Z","1.0.1":"2018-03-21T16:22:51.887Z"},"homepage":"https://github.com/enquirer/prompt-expand","keywords":["answer","answers","ask","checkbox","choice","cli","command","enquirer","enquirerprompt","expand","input","inquire","inquirer","interact","list","menu","password","prompt","prompts","question","readline","stdin","stdout","terminal","tty","ui"],"repository":{"type":"git","url":"git+https://github.com/enquirer/prompt-expand.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/enquirer/prompt-expand/issues"},"license":"MIT","readmeFilename":"README.md","users":{"mrzmmr":true}}