1.0.0 • Published 4 years ago

quickask v1.0.0

Weekly downloads
1
License
CC-BY-NC-SA-4.0
Repository
github
Last release
4 years ago

Quick Ask

Just need basic user input without any other packages

Simple user input until enter is pressed. Backspace will remove last character

ALso has a Y/N function that does not require pressing enter

Based on David Mark Clements's prompt sync , but simplified

Also referenced Command Line with ANSI escape codes

Requires:

  • Node 12.x, maybe earlier

Usage:

QuickAsk

const quickAsk = require("quickask").QuickAsk;

let reply = quickAsk("types some stuff. Press <enter> when done: ");
console.log("You typed: " + reply);

results:

type some stuff. Press <enter> when done: klkj;fgjgjjjjg    jjj
You typed: klkj;fgjgjjjjg    jjj

#QuickYN

const quickYN = require("quickask").QuickYN;
let reply = quickYN('Yes/No Question [Y/N] ');
console.log("You typed: " + reply)

results:

Yes/No Question [Y/N] N
You typed: N

License:

CC-BY-NC-SA-4.0 Attribution-NonCommercial-ShareAlike 4.0 International

Miscellany

Near Future to-dos

None

Version History

1.0.0 Has basic Ask and YN functionality I needed

Added QuickYN to take a single character input w/o pressing enter key

0.0.2 - Initial build-up

Have QuickAsk working with process.stdin and process.stdout calls to position prompt, cursor, and types chars

Historical Context

Global pandemic, US Election a month or so away, US President has Covid, and everyone is very confused

1.0.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago