# through-json

> Through stream that parses each write as a JSON message.

Latest version **1.1.0** (published 2014-07-12) · 0 weekly downloads

## Install

```sh
npm install through-json
pnpm add through-json
yarn add through-json
bun add through-json
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2014-07-12 |
| First published | 2014-03-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Maintainers | mafintosh |
| Keywords | stream, streams2, through, json, parse |

## Links

- npm: https://www.npmjs.com/package/through-json
- Repository: https://github.com/mafintosh/through-json
- Issues: https://github.com/mafintosh/through-json/issues
- npm.io page: https://npm.io/package/through-json

## Dependencies (1)

- [through2](https://npm.io/package/through2.md) ^0.5.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

- 1.1.0 (latest) — 2014-07-12
- 1.0.1 — 2014-06-09
- 1.0.0 — 2014-06-09
- 0.1.1 — 2014-03-20
- 0.1.0 — 2014-03-20

## README

# through-json

Through stream that parses each write as a JSON message.

	npm install through-json

[![build status](https://secure.travis-ci.org/mafintosh/through-json.png)](http://travis-ci.org/mafintosh/through-json)

## Usage

``` js
var parse = require('through-json');

// parse returns a streams2 through stream

var p = parse();

p.on('data', function(data) {
	console.log(data.message);
});

p.on('end', function() {
	console.log('no more messages');
});

// each write must be a complete JSON message

p.write('{"message":"test"}');
p.write('{"message":"another test"}');
p.end();
```

Running the above program produces the following output

```
test
another test
no more messages
```

## License

MIT

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