json-stream-combiner
Easey way to take json objects or files and write them to a destination file.
Last updated 4 years ago by stefanhayden .
ISC · Original npm · Tarball · package.json
$ cnpm install json-stream-combiner 
SYNC missed versions from official npm registry.

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:

var jsonStreamCombiner = require('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 }
]

Current Tags

  • 1.0.2                                ...           latest (4 years ago)

3 Versions

  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |