simple-input

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i simple-input

Weekly Downloads

5

Version

1.0.1

License

ISC

Unpacked Size

20 kB

Total Files

4

Last publish

Collaborators

  • airportyh