portsoc-readline
v0.0.2
Published
Easy-to-use promise-based input
Downloads
2
Readme
portsoc-readline – easy-to-use promise-based input
This is an input library that provides a single method question
which gets user input. It's promise-based so it works nicely with top-level await, meaning you can use it like this:
const drink = await question('tea or coffee?');
Installation
npm install portsoc-readline
Example:
import { question } from 'portsoc-readline';
const name = await question("Hi, what's your name?");
console.log(`Hello, ${name}!`);