# read

> read(1) for node programs

Latest version **6.0.0** (published 2026-05-15) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-05-15 |
| First published | 2011-12-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^22.22.2 \|\| ^24.15.0 \|\| >=26.0.0 |
| Dependencies | 1 |
| Unpacked size | 25.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 198 |
| Author | GitHub Inc. |
| Maintainers | saquibkhan, npm-cli-ops, reggi, owlstronaut |

## Links

- npm: https://www.npmjs.com/package/read
- Repository: https://github.com/npm/read
- Homepage: https://github.com/npm/read#readme
- Issues: https://github.com/npm/read/issues
- npm.io page: https://npm.io/package/read

## Dependencies (1)

- [mute-stream](https://npm.io/package/mute-stream.md) ^4.0.0

## Recent versions

- 6.0.0 (latest) — 2026-05-15
- 5.0.1 — 2025-10-23
- 5.0.0 — 2025-10-22
- 4.1.0 — 2025-01-30
- 4.0.0 — 2024-09-25
- 3.0.1 — 2023-11-27
- 3.0.0 — 2023-11-18
- 2.1.0 — 2023-04-13
- 2.0.0 — 2022-12-13
- 1.0.7 — 2015-08-26
- 1.0.6 — 2015-05-20
- 1.0.5 — 2013-07-15
- 1.0.4 — 2012-08-17
- 1.0.3 — 2012-08-12
- 1.0.2 — 2012-07-24
- … 7 more at https://npm.io/package/read/versions

## README

## read

For reading user input from stdin.

Similar to the `readline` builtin's `question()` method, but with a
few more features.

## Usage

```javascript
const { read } = require('read')
// or with ESM: import { read } from 'read'
try {
  const result = await read(options)
} catch (er) {
  console.error(er)
}
```

## Options

Every option is optional.

* `prompt` What to write to stdout before reading input.
* `silent` Don't echo the output as the user types it.
* `replace` Replace silenced characters with the supplied character value.
* `timeout` Number of ms to wait for user input before giving up.
* `default` The default value if the user enters nothing.
* `edit` Allow the user to edit the default value.
* `terminal` Treat the output as a TTY, whether it is or not.
* `input` Readable stream to get input data from. (default `process.stdin`)
* `output` Writable stream to write prompts to. (default: `process.stdout`)
* `completer` Autocomplete callback (see [official api](https://nodejs.org/api/readline.html#readline_readline_createinterface_options) for details
* `history` History array, which will be appended to.

If silent is true, and the input is a TTY, then read will set raw
mode, and read character by character.

## Contributing

Patches welcome.

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