0.0.4 • Published 4 years ago

json-cat-parser v0.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

json-cat-parser

concatenated json parser

Read chunks of json as they become available

Usage

import getParser from 'json-cat-parser';

const outputStream = await getParser("http://www.someLocation.com", {
  itemArrayElementName: "results"
});

const outputArrays = [];

outputStream.on("data", outputChunk => {
  const itemsArray = JSON.parse(arrayBufferToString(outputChunk));
  outputArrays.push(...itemsArray);

  // do whatever processing you need to for the entities returned
});

outputStream.on("end", () => {
  // anything you need to do when the request completed
});

config parameter

the config parameter to getParser currently only has the itemArrayElementName property. This property tells the parser where to locate the array of entities that it should parse.

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago