prop-stream

0.0.0 • Public • Published

Installation

$ npm install prop-stream

NPM

Usage

You can control which properties may exist on objects passing through an obj stream with a whitelist:

var through = require('through2'),
    stream = require('prop-stream');
 
// set up a pipeline
var pip = stream.whitelist( [ 'id', 'name', 'hat_size' ] )
  .pipe( through.obj( function( chunk, enc, next ){
    console.log( Object.keys( chunk ) );
    next();
  }));
 
// the 'arms' property will now be `deleted` from the object.
pip.write( { id: 1, name: 'peter', hat_size: 'medium', arms: 2 } );

There is also a blacklist which does the opposite.

NPM Module

The prop-stream npm module can be found here:

https://npmjs.org/package/prop-stream

Contributing

Please fork and pull request against upstream master on a feature branch.

Pretty please; provide unit tests and script fixtures in the test directory.

Running Unit Tests

$ npm test

Continuous Integration

Travis tests every release against node version 0.10

Build Status

Package Sidebar

Install

npm i prop-stream

Weekly Downloads

0

Version

0.0.0

License

MIT

Last publish

Collaborators

  • missinglink
  • dianashk
  • julian_mapzen
  • pelias
  • trescube