# json-stream-combiner

> Easey way to take json objects or files and write them to a destination file.

Latest version **2.0.2** (published 2024-04-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install json-stream-combiner
pnpm add json-stream-combiner
yarn add json-stream-combiner
bun add json-stream-combiner
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2024-04-27 |
| First published | 2016-05-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.x |
| Dependencies | 3 |
| Unpacked size | 18.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Stefan Hayden |
| Maintainers | stefanhayden |
| Keywords | json, stream, combine |

## Links

- npm: https://www.npmjs.com/package/json-stream-combiner
- npm.io page: https://npm.io/package/json-stream-combiner

## Dependencies (3)

- [JSONStream](https://npm.io/package/JSONStream.md) ^1.3.5
- [stream-array](https://npm.io/package/stream-array.md) ^1.1.2
- [stream-transform](https://npm.io/package/stream-transform.md) ^3.3.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.0.2 (latest) — 2024-04-27
- 2.0.1 — 2024-04-27
- 2.0.0 — 2024-04-27
- 1.0.3 — 2024-04-27
- 1.0.2 — 2016-05-22
- 1.0.1 — 2016-05-22
- 1.0.0 — 2016-05-22

## README

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:
```json
[
	{ "x": 1, "y": 2 },
	{ "q": 1, "w": 2 }
]
```

We can pass that in like this:

```javascript
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:

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

---
_Source: https://npm.io/package/json-stream-combiner · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
