Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

simple-input

airportyh22ISC1.0.1

A prompt library for node.js that is simple.

readme

Simple Input

An input/prompt library for node.js that is simple.

Usage

The recommended usage is with async/await syntax:

const prompt = require("simple-input");

async function main() {
    const name = await prompt("What is your name?");
    console.log(`Hello, ${name}!`);
}

main().catch(err => console.error(err.message));

But you can also use the promise style as the function returns a promise:

const prompt = require("simple-input");

prompt("What is your name?")
    .then((name) => {
        console.log(`Hello, ${name}!`);
    })
    .catch(err => {
        console.error(err.message);
    });