@putout/cli-choose

2.0.0 • Public • Published

@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

Dependents (4)

Package Sidebar

Install

npm i @putout/cli-choose

Weekly Downloads

3,521

Version

2.0.0

License

MIT

Unpacked Size

3.71 kB

Total Files

5

Last publish

Collaborators

  • coderaiser