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

select-shell

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

select-shell

list of select for nodejs on terminal.

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-98.99%
Maintainers
1
Weekly downloads
 
Created
Source

select-shell

list of select for nodejs on terminal.

###Install

  $ npm install select-shell

###Using

Navigate with arrows

Up and Down - Navigates on the options
Right - Check the option
Left - Uncheck the option
Enter/Return - confirms the options selected
Esc - Cancel/Exit

###Code


'use strict';

var selectShell = require('./index');
var stream = process.stdin;
var select = selectShell();

/* 
  select.option(text, value)
  Value is optinal. The default value is equal the text.
*/
select.option('One', 1)
      .option('Two', 2)
      .option('Three', 3)
      .select();

select.on('select', function(options){
  /* Return the options selected. Ex.: [{ text: '', value: '' }] or { text: '', value: '' } depends the config multiSelect */
  console.log(options);
  process.exit(0);
});

select.on('cancel', function(options){
  /* Return the options selected. Ex.: [{ text: '', value: '' }] or { text: '', value: '' } depends the config multiSelect */
  console.log('Cancel select, '+ options.length +' options selected');
  process.exit(0);
});

###Optional configs

var select = require('select-shell)(
  /* Default values */
  {
    pointer: '> ',
    pointerColor: 'white',
    checked: ' ✓',
    checkedColor: 'green',
    msgCancel: 'No selected options!',
    msgCancelColor: 'red',
    multiSelect: true
  }
);

###The scheme of color is equal to the module colors.

  • bold
  • italic
  • underline
  • inverse
  • yellow
  • cyan
  • white
  • magenta
  • green
  • red
  • grey
  • blue
  • rainbow
  • zebra
  • random

Keywords

FAQs

Package last updated on 04 Aug 2014

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