# reader-line-iterator

> Convert a reader into a async iterator emitting text lines

Latest version **1.2.3** (published 2025-11-26) · 0BSD license · 0 weekly downloads

## Install

```sh
npm install reader-line-iterator
pnpm add reader-line-iterator
yarn add reader-line-iterator
bun add reader-line-iterator
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2025-11-26 |
| First published | 2020-10-02 |
| Weekly downloads | 0 |
| License | 0BSD |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=24.11.1 |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Maintainers | arlac77 |

## Links

- npm: https://www.npmjs.com/package/reader-line-iterator
- Repository: https://github.com/arlac77/reader-line-iterator
- Homepage: https://github.com/arlac77/reader-line-iterator#readme
- Issues: https://github.com/arlac77/reader-line-iterator/issues
- npm.io page: https://npm.io/package/reader-line-iterator

## Recent versions

- 1.2.3 (latest) — 2025-11-26
- 1.2.2 — 2025-05-06
- 1.2.1 — 2025-05-06
- 1.2.0 — 2024-02-12
- 1.1.6 — 2023-06-19
- 1.1.5 — 2022-08-30
- 1.1.4 — 2022-07-17
- 1.1.3 — 2022-07-17
- 1.1.2 — 2021-07-02
- 1.1.1 — 2021-06-15
- 1.1.0 — 2021-04-25
- 1.0.1 — 2020-12-12
- 1.0.0 — 2020-10-02

## README

[![npm](https://img.shields.io/npm/v/reader-line-iterator.svg)](https://www.npmjs.com/package/reader-line-iterator)
[![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
[![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org)
[![bundlejs](https://deno.bundlejs.com/?q=reader-line-iterator\&badge=detailed)](https://bundlejs.com/?q=reader-line-iterator)
[![downloads](http://img.shields.io/npm/dm/reader-line-iterator.svg?style=flat-square)](https://npmjs.org/package/reader-line-iterator)
[![GitHub Issues](https://img.shields.io/github/issues/arlac77/reader-line-iterator.svg?style=flat-square)](https://github.com/arlac77/reader-line-iterator/issues)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Freader-line-iterator%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/reader-line-iterator/goto)
[![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Known Vulnerabilities](https://snyk.io/test/github/arlac77/reader-line-iterator/badge.svg)](https://snyk.io/test/github/arlac77/reader-line-iterator)
[![Coverage Status](https://coveralls.io/repos/arlac77/reader-line-iterator/badge.svg)](https://coveralls.io/github/arlac77/reader-line-iterator)

# reader-line-iterator

Convert a reader into a async iterator emitting text lines

```js
import { lineIterator } from "reader-line-iterator";

const result = await fetch("http://somewhere/mytext.txt");

for await (const line of lineIterator(result.body.getReader())) {
    console.log(line);
}
```

# API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

*   [lineIterator](#lineiterator)
    *   [Parameters](#parameters)

## lineIterator

Extracts lines from a reader and delivers them as an async iterator.

### Parameters

*   `reader` **(ReadableStreamDefaultReader | ReadableStreamBYOBReader)**&#x20;
*   `decoder` **[TextDecoder](https://developer.mozilla.org/docs/Web/API/TextDecoder)**  (optional, default `new TextDecoder()`)

Returns **AsyncIterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** extracted lines

# install

With [npm](http://npmjs.org) do:

```shell
npm install reader-line-iterator
```

# license

BSD-2-Clause

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