# @types/line-by-line

> TypeScript definitions for line-by-line

Latest version **0.1.9** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/line-by-line
pnpm add @types/line-by-line
yarn add @types/line-by-line
bun add @types/line-by-line
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2023-11-07 |
| First published | 2017-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51419 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/line-by-line
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/line-by-line
- npm.io page: https://npm.io/package/@types/line-by-line

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 0.1.9 (latest) — 2023-11-07
- 0.1.7 (ts4.3) — 2023-08-30
- 0.1.6 (ts3.8) — 2021-12-24
- 0.1.5 (ts3.6) — 2021-07-08
- 0.1.4 (ts2.8) — 2020-01-09
- 0.1.3 (ts2.1) — 2019-05-13
- 0.1.8 — 2023-10-18
- 0.1.2 — 2017-10-25
- 0.1.1 — 2017-03-24
- 0.1.0 — 2017-03-10

## README

# Installation
> `npm install --save @types/line-by-line`

# Summary
This package contains type definitions for line-by-line (https://github.com/Osterjour/line-by-line).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/line-by-line.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/line-by-line/index.d.ts)
````ts
/// <reference types="node" />

import { EventEmitter } from "events";
import { Readable } from "stream";

interface LineByLineReaderOptions {
    /** The encoding to use. */
    encoding?: "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex" | undefined;
    /** If set to true, empty lines do not emit the "line" event. */
    skipEmptyLines?: boolean | undefined;
}

interface LineByLineReaderFileOptions extends LineByLineReaderOptions {
    /** The `end` position in bytes to read from the file. */
    end?: number | undefined;
    /** The `start` position in bytes to read from the file. */
    start?: number | undefined;
}

declare class LineByLineReader extends EventEmitter {
    /**
     * Constructs a new `LineByLineReader` from a path to a file.
     * @param filePath The path to the file to read.
     * @param options Optional. The options used when constructing the new `LineByLineReader` object.
     */
    constructor(filePath: string, options?: LineByLineReaderFileOptions);
    /**
     * Constructs a new `LineByLineReader` from a readable stream.
     * @param stream The stream to read.
     * @param options Optional. The options used when constructing the new `LineByLineReader` object.
     */
    constructor(stream: Readable, options?: LineByLineReaderOptions);

    /**
     * Stops emitting "line" events, closes the file or stream, and emits the "end" event.
     */
    close(): void;

    /**
     * Emitted if all lines are read.
     * @param event
     * @param listener
     */
    on(event: "end", listener: () => void): this;
    /**
     * Emitted if an error occured.
     * @param event
     * @param listener A listener that receives the error object.
     */
    on(event: "error", listener: (err: any) => void): this;
    /**
     * Emitted on every line read.
     * @param event
     * @param listener A listener that receives the line without the line terminator.
     */
    on(event: "line", listener: (line: string) => void): this;

    /**
     * Call this method to stop emitting "line" events.
     */
    pause(): void;

    /**
     * After calling this method, "line" events get emitted again.
     */
    resume(): void;
}

export = LineByLineReader;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:38 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by .

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