Thin wrapper for JSONStream parse.
$ npm install flow-parsevareventStream=require('event-stream'),pStream=require('flow-parse');// Create a new stream, passing along an optional error handler:varstream=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:functiononError(error){if(error){console.error(error.stack);thrownewError('Error!!!');}}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:
$ mochaAll new feature development should have corresponding unit tests to validate correct functionality.
Copyright © 2014. Athan Reines.