1.0.0 • Published 6 years ago

wait-for-user-input v1.0.0

Weekly downloads
293
License
ISC
Repository
github
Last release
6 years ago

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

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago