tty-selector
v1.1.0
Published
A lightweight multi-choice cli selector for NodeJs
Downloads
3
Readme
tty-selector
A lightweight multi-choice cli selector for NodeJs
Installation
You can install this package by running:
npm i tty-selectorUsage
You can use tty-selector like this:
import selector from "tty-selector";
const result = await selector("What chocolate do you prefer?", [
"White chocolate",
"Dark chocolate",
"Milk chocolate",
]).catch(() => {
console.log("Choice cancelled!");
});
console.log("You have choosen:", result);