Noosphere Possibilities Maximized
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

wait-for-user-input

1.0.0 • Public • Published

wait-for-user-input

NPM

minimal way to wait for user input on the terminal.

handles single character user input. (y/n)

async main () {
  const input = await waitForUserInput('do you agree?')
  ...
}

installation

npm i wait-for-user-input

usage

async / await

const waitForUserInput = require('wait-for-user-input')

main()

async function main () {
  const userInput = await waitForUserInput('')
  // handle user input
}

promises

const waitForUserInput = require('wait-for-user-input')

waitForUserInput('')
.then(userInput => {
  // handle user input
})

Keywords

none

install

npm i wait-for-user-input

Downloadsweekly downloads

54

version

1.0.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability