@putout/cli-choose
show select to choose one item from list
Last updated 3 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/cli-choose 
SYNC missed versions from official npm registry.

@putout/cli-choose NPM version

Show ui to choose one item from list.

Install

npm i @putout/cli-choose

Examples

import {choose} from '@putout/cli-choose';

choose('hello?', [
    'one',
    'two',
    'three',
    'four',
]);

// returns
'one';

When you need to set focus use autofocus:

import {choose} from './lib/choose.js';

const choices = [
    'one',
    'two',
    'three',
    'four',
];

choose('hello?', items, {
    autofocus: 3,
});

// show ui with focus on item 'three'.

License

MIT

Current Tags

  • 4.0.0                                ...           latest (2 months ago)

8 Versions

  • 4.0.0                                ...           2 months ago
  • 3.0.1                                ...           3 months ago
  • 3.0.0                                ...           5 months ago
  • 2.0.0                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (2)
Dev Dependencies (8)

Copyright 2013 - present © cnpmjs.org | Home |