stream-police

block stream data on criteria

npm install stream-police
21 downloads in the last week
26 downloads in the last month

stream-police

Build Status

filter some streams and stuff.

usage

Pass an array of RegExps in either exclude to block that chunk or verify to only allow that. Err... examples:

var police = require('stream-police')

r.pipe(police({ exclude: [/bad/, /nogood/] })).pipe(process.stdout)

where r is an imaginary readable stream. No chunk including the phrases 'bad' or 'nogood' will ever reach stdout.

or:

var police = require('stream-police')

r.pipe(police({ verify: [/good/, /notbad/] })).pipe(process.stdout)

to make sure everything that goes through is 'good' or 'notbad'.

license

MIT

npm loves you