strainer
Simple filtering of arrays and object streams.
Installation
npm install strainer
Basic Use (Stream)
var strainer = ;var input = ; input;
Basic Use (Array / Callback)
var strainer = ;var input = 'bar':'foo' 'foo':'bar'; ;
Using Functions as Values
If a function is provided as the "value" attribute, it will be used as a subroutine to evaluate each object. For example:
var strainer = ;var someArray = foo: 1 foo: 2 foo: 3 foo: 4; ;
Selectors
Strainer supports the use of JS-style object selectors. For example, let's say you had a complex object:
Here, you could use a selector to filter out a property that is buried deep within each object:
input;
Testing
npm test
Naïve Benchmarks
make benchmark