2.0.2 • Published 10 days ago

json-stream-combiner v2.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
10 days ago

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 }
]