portsoc-readline

0.0.2 • Public • Published

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}!`);

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i portsoc-readline

      Weekly Downloads

      0

      Version

      0.0.2

      License

      ISC

      Unpacked Size

      1.5 kB

      Total Files

      4

      Last publish

      Collaborators

      • portsoc