Skip to content

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

License

Notifications You must be signed in to change notification settings

flow-io/flow-nans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published