# keypress-promises

> Await a single keypress from the terminal user

Latest version **0.3.0** (published 2023-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install keypress-promises
pnpm add keypress-promises
yarn add keypress-promises
bun add keypress-promises
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2023-06-27 |
| First published | 2023-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nicholas Hobbs |
| Maintainers | nhobbs |
| Keywords | ui |

## Links

- npm: https://www.npmjs.com/package/keypress-promises
- Repository: https://github.com/nickhobbs94/keypress-promises
- Issues: https://github.com/nickhobbs94/keypress-promises/issues
- npm.io page: https://npm.io/package/keypress-promises

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2023-06-27
- 0.2.1 — 2023-06-24
- 0.2.0 — 2023-06-24
- 0.1.9 — 2023-06-24
- 0.1.8 — 2023-06-24
- 0.1.7 — 2023-06-24
- 0.1.6 — 2023-06-24
- 0.1.5 — 2023-06-24
- 0.1.4 — 2023-06-24
- 0.1.3 — 2023-06-24
- 0.1.2 — 2023-06-24
- 0.1.1 — 2023-06-24
- 0.1.0 — 2023-06-24

## README

## Installation
Use node 20+
```
npm i keypress-promises
```

## Example usage

```
import { getKey, getInput } from 'keypress-promises';

const key = await getKey();
console.log(key);
// { sequence: 'j', name: 'j', ctrl: false, meta: false, shift: false }
// { sequence: '\x03', name: 'c', ctrl: true, meta: false, shift: false }

const userInput = await getInput('Enter your name: ');
console.log(`Your name is ${userInput}`);
// Your name is nick

```

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