json-cat-parser

0.0.4 • Public • Published

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.

Package Sidebar

Install

npm i json-cat-parser

Weekly Downloads

1

Version

0.0.4

License

ISC

Unpacked Size

5.7 kB

Total Files

3

Last publish

Collaborators

  • rcbeav