json-stream-combiner
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

Json Stream Combiner

A simple API to stream combine many json files, json objects, or array of json objects into a single output file.

npm install json-stream-combiner

If we have this input file:

[
	{ "x": 1, "y": 2 },
	{ "q": 1, "w": 2 }
]

We can pass that in like this:

import jsonStreamCombiner from 'jsonStreamCombiner';

jsonStreamCombiner([
	'/absolute/path/to/json/input.json',
	{ a: 1, b: 2 },
	[ { c: 1, d: 2 }, { e: 1, d: 2 } ]
], 
'/absolute/path/to/json/output.json').then(function() {
	console.log('Done!');
})

and then output.json will have this output:

[
	{ "x": 1, "y": 2 },
	{ "q": 1, "w": 2 },
	{ "a": 1, "b": 2 },
	{ "c": 1, "d": 2 }, 
	{ "e": 1, "d": 2 }
]

/json-stream-combiner/

    Package Sidebar

    Install

    npm i json-stream-combiner

    Weekly Downloads

    5

    Version

    2.0.2

    License

    ISC

    Unpacked Size

    19.1 kB

    Total Files

    22

    Last publish

    Collaborators

    • stefanhayden