Skip to content

flow-io/flow-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flow-parse

Thin wrapper for JSONStream parse.

Installation

$ npm install flow-parse

Examples

var eventStream = require( 'event-stream' ),
	pStream = require( 'flow-parse' );

// Create a new stream, passing along an optional error handler:
var stream = pStream()
	.stream( onError );

// Create the pipeline:
stream.pipe( eventStream.stringify() )
	.pipe( process.stdout );

// Write data to the stream:
stream.write( "{ \"x\": 0, \"y\": 0 }" );
stream.end();

// Error handler:
function onError( error ) {
	if ( error ) {
		console.error( error.stack );
		throw new Error( 'Error!!!' );
	}
}

Tests

Unit tests use the Mocha test framework with Chai assertions.

Assuming you have installed Mocha, execute the following command in the top-level application directory to run the tests:

$ mocha

All new feature development should have corresponding unit tests to validate correct functionality.

License

MIT license.


Copyright

Copyright © 2014. Athan Reines.

About

Thin wrapper for JSONStream parse.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published