You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
367 B
JavaScript
15 lines
367 B
JavaScript
"use strict";
|
|
|
|
const pipe = require("@promistream/pipe");
|
|
const splitLines = require("@promistream/split-lines");
|
|
const map = require("@promistream/map");
|
|
const decodeString = require("@promistream/decode-string");
|
|
|
|
module.exports = function createNDJSONParseStream() {
|
|
return pipe([
|
|
decodeString("utf8"),
|
|
splitLines(),
|
|
map((line) => JSON.parse(line))
|
|
]);
|
|
};
|