Skip to content

tanem/transform-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

transform-parse

Build Status Coverage Status NPM version

A transform stream that parses an incoming stream as JSON.

Installation

$ npm install transform-parse --save

Example

var stream = require('stream');
var parse = require('transform-parse');
var source = stream.PassThrough();
var dest = stream.PassThrough({ objectMode: true });

source.pipe(parse()).pipe(dest);
source.end(new Buffer('{ "foo": "bar" }'));

dest.on('data', function(obj){
  // => { foo: 'bar' }
  console.log(obj);
});

API

var parse = transformParse()

Initialise a new TransformParse.

Testing

$ npm run test-spec

To generate a coverage report:

$ npm run test-cov

About

A transform stream that parses an incoming stream as JSON.

Resources

License

Stars

Watchers

Forks

Packages

No packages published