mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-08 09:52:51 +00:00
16 lines
398 B
TypeScript
16 lines
398 B
TypeScript
import * as ndjson from "ndjson";
|
|
import * as fs from "fs";
|
|
|
|
let parser = ndjson.parse();
|
|
parser = ndjson.parse({ strict: true });
|
|
|
|
fs.createReadStream("data.txt")
|
|
.pipe(parser)
|
|
.on("data", (obj) => undefined);
|
|
|
|
let serialize = ndjson.serialize();
|
|
serialize = ndjson.stringify({ encoding: "ascii" });
|
|
serialize.on("data", (line) => undefined);
|
|
serialize.write({ foo: "bar" });
|
|
serialize.end();
|