{"id":13447591,"url":"https://github.com/enquirer/prompt-list","last_synced_at":"2025-04-10T12:33:17.228Z","repository":{"id":57341731,"uuid":"66805427","full_name":"enquirer/prompt-list","owner":"enquirer","description":"This repository has been archived, use Enquirer instead.","archived":false,"fork":false,"pushed_at":"2018-05-28T20:11:09.000Z","size":75,"stargazers_count":14,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T11:13:13.309Z","etag":null,"topics":["cli","enquirer","prompt","prompts","questions","readline","terminal"],"latest_commit_sha":null,"homepage":"https://github.com/enquirer/enquirer","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enquirer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-29T02:43:59.000Z","updated_at":"2025-01-07T21:33:57.000Z","dependencies_parsed_at":"2022-09-15T16:21:49.125Z","dependency_job_id":null,"html_url":"https://github.com/enquirer/prompt-list","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enquirer%2Fprompt-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enquirer%2Fprompt-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enquirer%2Fprompt-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enquirer%2Fprompt-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enquirer","download_url":"https://codeload.github.com/enquirer/prompt-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142905,"owners_count":21054671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","enquirer","prompt","prompts","questions","readline","terminal"],"created_at":"2024-07-31T05:01:21.861Z","updated_at":"2025-04-10T12:33:17.209Z","avatar_url":"https://github.com/enquirer.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# prompt-list [![NPM version](https://img.shields.io/npm/v/prompt-list.svg?style=flat)](https://www.npmjs.com/package/prompt-list) [![NPM monthly downloads](https://img.shields.io/npm/dm/prompt-list.svg?style=flat)](https://npmjs.org/package/prompt-list)  [![NPM total downloads](https://img.shields.io/npm/dt/prompt-list.svg?style=flat)](https://npmjs.org/package/prompt-list) [![Linux Build Status](https://img.shields.io/travis/enquirer/prompt-list.svg?style=flat\u0026label=Travis)](https://travis-ci.org/enquirer/prompt-list) [![Windows Build Status](https://img.shields.io/appveyor/ci/enquirer/prompt-list.svg?style=flat\u0026label=AppVeyor)](https://ci.appveyor.com/project/enquirer/prompt-list)\n\n\u003e List-style prompt. Can be used as a standalone prompt, or with a prompt system like [enquirer](http://enquirer.io).\n\nFollow this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), for updates on this project and others.\n\n![prompt-list example](https://raw.githubusercontent.com/enquirer/prompt-list/master/docs/example.gif)\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save prompt-list\n```\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save prompt-list\n```\n\n## Example usage\n\n```js\nvar List = require('prompt-list');\nvar list = new List({\n  name: 'order',\n  message: 'What would you like to order?',\n  // choices may be defined as an array or a function that returns an array\n  choices: [\n    'Coke',\n    'Diet Coke',\n    'Cherry Coke',\n    {name: 'Sprite', disabled: 'Temporarily unavailable'},\n    'Water'\n  ]\n});\n\n// async\nlist.ask(function(answer) {\n  console.log(answer);\n});\n\n// promise\nlist.run()\n  .then(function(answer) {\n    console.log(answer);\n  });\n```\n\n## Enquirer usage\n\nRegister the prompt as an [enquirer](http://enquirer.io) plugin:\n\n```js\nvar Enquirer = require('enquirer');\nvar enquirer = new Enquirer();\n\nenquirer.register('list', require('prompt-list'));\n```\n\n### Enquirer examples\n\nEnquirer supports both declarative, inquirer-style questions, and an expressive format, using the `.question` method:\n\n**Declarative**\n\n```js\nvar questions = [\n  {\n    type: 'list',\n    name: 'order',\n    message: 'What would you like to order?',\n    choices: [\n      'Coke',\n      'Diet Coke',\n      'Cherry Coke',\n      {name: 'Sprite', disabled: 'Temporarily unavailable'},\n      'Water'\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**Expressive**\n\n```js\nenquirer.question('order', 'What would you like to order?', {\n  type: 'list',\n  choices: [\n    'Coke',\n    'Diet Coke',\n    'Cherry Coke',\n    {name: 'Sprite', disabled: 'Temporarily unavailable'},\n    'Water'\n  ]\n});\n\nenquirer.ask(['order'])\n  .then(function(answers) {\n    console.log(answers);\n  })\n  .catch(function(err) {\n    console.log(err);\n  });\n```\n\n## About\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [enquirer-prompt](https://www.npmjs.com/package/enquirer-prompt): Base prompt module used for creating custom prompt types for Enquirer. | [homepage](https://github.com/jonschlinkert/enquirer-prompt \"Base prompt module used for creating custom prompt types for Enquirer.\")\n* [enquirer-question](https://www.npmjs.com/package/enquirer-question): Question object, used by Enquirer and prompt plugins. | [homepage](https://github.com/enquirer/enquirer-question \"Question object, used by Enquirer and prompt plugins.\")\n* [enquirer](https://www.npmjs.com/package/enquirer): Intuitive, plugin-based prompt system for node.js. | [homepage](http://enquirer.io \"Intuitive, plugin-based prompt system for node.js.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 45 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 6  | [doowb](https://github.com/doowb) |  \n| 3  | [albizures](https://github.com/albizures) |  \n\n### Building docs\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 \u0026\u0026 verb\n```\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 \u0026\u0026 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 December 28, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenquirer%2Fprompt-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenquirer%2Fprompt-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenquirer%2Fprompt-list/lists"}