# wait-for-user-input

> minimal way to wait for user input on the terminal.

Latest version **1.0.0** (published 2018-02-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install wait-for-user-input
pnpm add wait-for-user-input
yarn add wait-for-user-input
bun add wait-for-user-input
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-02-01 |
| First published | 2018-02-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | christian_fei |

## Links

- npm: https://www.npmjs.com/package/wait-for-user-input
- Repository: https://github.com/christian-fei/wait-for-user-input
- Homepage: https://github.com/christian-fei/wait-for-user-input#readme
- Issues: https://github.com/christian-fei/wait-for-user-input/issues
- npm.io page: https://npm.io/package/wait-for-user-input

## Recent versions

- 1.0.0 (latest) — 2018-02-01

## README

# wait-for-user-input

[![NPM](https://nodei.co/npm/wait-for-user-input.png)](https://npmjs.org/package/wait-for-user-input)

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

---
_Source: https://npm.io/package/wait-for-user-input · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
