async-prompt

1.0.1 • Public • Published

async-prompt

Sane terminal user-input for nodejs that return thunks for Promise.

Installation

$ npm install async-prompt

Examples

const name = await prompt('username: ');
const pass = await password('password: ');
const desc = await multiline('description: ');
const ok = await confirm('are you sure? ');

API

prompt(msg)

Prompt for user input with msg.

prompt.password(msg, [mask])

Prompt for password input with msg and optional mask defaulting to "*".

if run without tty, will use prompt(msg) instead

prompt.multiline(msg)

Prompt for multi-line input with msg.

prompt.confirm(msg)

Prompt for confirmation with msg.

License

MIT

Forked from co-prompt

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    546
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    546
  • 1.0.0
    0

Package Sidebar

Install

npm i async-prompt

Weekly Downloads

546

Version

1.0.1

License

MIT

Last publish

Collaborators

  • yeliex