json-obj-by-obj-stream
v1.0.0
Published
A script for persing json data object by object
Downloads
1
Readme
json-obj-by-obj-stream
json obj by obj stream parser
script parse a large streams of json data, object by object
example usage
const PATH = "...json";
const readFileStream = fs.createReadStream(PATH, "utf8");
let jsonFileParser = new JsonStreamParser(function (err, obj) {
if (err) {
console.log(err.message);
} else if (obj) {
console.log(obj);
} else {
console.log("File parsed.");
}
});
on every new chunk of data call it
const https = require("https");
readFileStream.on("data", (data) => {
jsonFileParser._jsonParser(data);
});