New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

choices

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

choices

Choices - an API for prompting the user with multiple choices

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
747
increased by14.57%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 10 Sep 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc