mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Overhauled the line-by-line package to be accurate. The prior version of @types/line-by-line did not properly represent the options used in creating a LineByLineReader and did not represent the stream compatibility the package has. This overhauls the declaration file to represent the package in both its use case of reading files and readable streams, as well as supplying documentation as found on the package's README.md. * Overhauled the line-by-line package to be accurate The prior version of @types/line-by-line did not properly represent the options used in creating a LineByLineReader and did not represent the stream compatibility the package has. This overhauls the declaration file to represent the package in both its use case of reading files and readable streams, as well as supplying documentation as found on the package's README.md. * Fixed code to conform to dtslint
8 lines
294 B
TypeScript
8 lines
294 B
TypeScript
import LineByLineReader = require("line-by-line");
|
|
|
|
const reader = new LineByLineReader("index.d.ts");
|
|
|
|
reader.on("end", () => console.log("end"));
|
|
reader.on("error", (err) => { throw new Error("Uh oh!~ There was an error reading the file"); });
|
|
reader.on("line", (line) => console.log(line));
|