Socket
Socket
Sign inDemoInstall

choices

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    choices

Choices - an API for prompting the user with multiple choices


Version published
Weekly downloads
642
increased by60.5%
Maintainers
1
Install size
29.4 kB
Created
Weekly downloads
 

Readme

Source

Choices

Choices is an API for prompting the user with multiple-choices.

Choices are displayed in a numbered list, user is prompted with a message and options repeatedly until they make a choice or cancel (q, esc, ctrl+c).

If the user cancels, your callback will receive null as the option index.

Install

npm install choices

Example

var choices = require('choices');
var options = ['First Option', 'Second option', 'Third option'];
choices('Pick an option', options, function(idx) {
  console.log('You picked ' + options[idx]);
});
  [1]: First option
  [2]: Second option
  [3]: Third option
Pick an option>> 2
You picked Second option

Keywords

FAQs

Last updated on 10 Sep 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc