flow-stringify
v0.0.1
Published
Thin wrapper for JSON stream stringify.
Downloads
2
Maintainers
Readme
flow-stringify
Thin wrapper for JSONStream stringify.
Installation
$ npm install flow-stringify
Examples
var sStream = require( 'flow-stringify' );
// Create a new stream, passing along an optional error handler:
var stream = sStream()
.stream( onError );
// Setup the pipeline:
stream.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
Copyright
Copyright © 2014. Athan Reines.