# askline

> A single-line prompt that allows reading data from user input

Latest version **1.0.0** (published 2021-07-12) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install askline
pnpm add askline
yarn add askline
bun add askline
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-07-12 |
| First published | 2021-07-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 17.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | addaleax |
| Keywords | input, prompt, tty, ask |

## Links

- npm: https://www.npmjs.com/package/askline
- Repository: https://github.com/mongodb-js/askline
- Issues: https://github.com/mongodb-js/askline/issues
- npm.io page: https://npm.io/package/askline

## Dependencies (2)

- [hijack-stream](https://npm.io/package/hijack-stream.md) ^1.0.0
- [handle-backspaces](https://npm.io/package/handle-backspaces.md) ^1.0.0

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-07-12

## README

# askline

A single-line prompt that allows reading data from user input.

```js
import askline from 'askline';

console.log('Please enter a something:');
const result = await askline({ input: process.stdin, output: process.stdout });
console.log('You entered the following password:', result.toString());
```

The stream passed to `askline` can be any kind of `Readable` stream.
If it is a TTY, `askline` will temporarily remove all other `'data'` and
`'readable'` listeners from it, and set the TTY into raw mode if it has not
been in raw mode to begin with.

## Why not use [`read`](https://www.npmjs.com/package/read) instead?

Because `read `does not work inside a Node.js REPL.

## LICENSE

Apache-2.0

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