flow-nans

0.0.2 • Public • Published

flow-nans

Through stream which removes all non-numeric values from a stream.

Installation

$ npm install flow-nans

Examples

var eventStream = require( 'event-stream' ),
    fStream = require( 'flow-nans' );
 
var data = new Array( 9 );
 
// Create some data...
data[ 0 ] = 'a';
data[ 1 ] = true;
data[ 2 ] = function(){};
data[ 3 ] = {};
data[ 4 ] = [];
data[ 5 ] = undefined;
data[ 6 ] = NaN;
data[ 7 ] = null;
data[ 8 ] = 0;
 
// Create a readable stream:
var readStream = eventStream.readArray( data );
 
// Create a new NaN filter stream:
var stream = fStream()
    .accessors( 'd', function ( d ) {
        return d;
    })
    .stream();
 
// Create the pipeline:
readStream.pipe( stream )
    .pipe( eventStream.stringify() )
    .pipe( process.stdout );

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.

/flow-nans/

    Package Sidebar

    Install

    npm i flow-nans

    Weekly Downloads

    1

    Version

    0.0.2

    License

    none

    Last publish

    Collaborators

    • kgryte