Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nisaacson/json-stringify-stream
Transform stream to stringify a readable stream of objects into json strings
https://github.com/nisaacson/json-stringify-stream
Last synced: about 1 month ago
JSON representation
Transform stream to stringify a readable stream of objects into json strings
- Host: GitHub
- URL: https://github.com/nisaacson/json-stringify-stream
- Owner: nisaacson
- Created: 2014-01-09T18:41:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-09T18:44:12.000Z (almost 11 years ago)
- Last Synced: 2024-04-14T14:46:43.375Z (7 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON StringifyStream
Stringify readable stream of objects into json strings
[![NPM](https://nodei.co/npm/json-stringify-stream.png)](https://nodei.co/npm/json-stringify-stream/)
[![Build Status](https://travis-ci.org/nisaacson/json-stringify-stream.png)](https://travis-ci.org/nisaacson/json-stringify-stream)
[![Dependency Status](https://david-dm.org/nisaacson/json-stringify-stream/status.png)](https://david-dm.org/nisaacson/json-stringify-stream)
[![Code Climate](https://codeclimate.com/github/nisaacson/json-stringify-stream.png)](https://codeclimate.com/github/nisaacson/json-stringify-stream)# Installation
```bash
npm install -S json-stringify-stream
```# Usage
Create an instance of Stringify and pipe a readable stream of objects into that instance
```javascript
var StringifyStream = require('json-stringify-stream')
// stringify is an instance of require('stream').Transform
var stringify = new StringifyStream()var readStream = {} // a stream of single objects
var stringify = readStream.pipe(splitter)
stringify.on('data', function(chunk) {
console.dir(chunk) // json string
})
stringify.on('finish', function() {
console.log('finish event called, all objects stringified')
})
```