0.0.3 • Published 8 days ago

bare-select-prompts v0.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 days ago

bare-select-prompts

Single and multiple select prompts for interactive CLIs.

npm i bare-select-prompts

Usage

const selection = require("bare-select-prompts");

process.stdin.setRawMode(true);

const sl = selection.createInterface({
  input: process.stdin,
  output: process.stdout,
  options: ["foo", "bar", "baz"],
});

sl.on("selection", (selection) => {
  console.log("The user selected: " + (selection ? selection : "nothing"));
  process.exit();
});

sl.on("close", () => {
  console.log("Exiting...");
  process.exit();
});

Output

[ ] foo
[*] bar
[ ] baz

Selected option: bar

The user selected: bar

License

Apache-2.0

0.0.3

8 days ago

0.0.2

14 days ago

0.0.1

21 days ago