# promise-readline

> promise-style line reader.

Latest version **1.0.8** (published 2018-04-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install promise-readline
pnpm add promise-readline
yarn add promise-readline
bun add promise-readline
```

## 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.8 |
| Published | 2018-04-14 |
| First published | 2017-12-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Magnus Lin, Ray Chen |
| Maintainers | magnuslin |
| Keywords | lineReader, readline, promise, file, stdin |

## Links

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

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.8 (latest) — 2018-04-14
- 1.0.7 — 2017-12-21
- 1.0.6 — 2017-12-21
- 1.0.5 — 2017-12-21
- 1.0.4 — 2017-12-21
- 1.0.3 — 2017-12-21
- 1.0.2 — 2017-12-20
- 1.0.1 — 2017-12-20
- 1.0.0 — 2017-12-20

## README

# promise-readline

read a file or stdin line by line in promise style.

# Install

```bash
npm install promise-readline --save
```

# Usage

```
// JFK.txt
We choose to go to the moon in this decade and do the other things,
not because they are easy, 
but because they are hard.
```

```javascript
const lineReader = require('promise-readline');
const fs = require('fs');

(async () => {
    //for stdin use: let lr = LineReader(process.stdin);
    let lr = lineReader(fs.createReadStream('JFK.txt'));

    await lr.readLine(); // We choose to go to the moon in this decade and do the other things,
    await lr.readLine(); // not because they are easy,
    await lr.readLine(); // but because they are hard.
    await lr.readLine(); // undefined

    lr.close();
})()
.catch(console.error);
```

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