2.0.1 • Published 9 years ago

dotpath-stream v2.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

dotpath-stream

Build Status npm install

transform object streams by dotpath lookup

usage

var dps = require('dotpath-stream')
  , imaginaryObjectStream

// pretend imaginaryObjectStream streams an object like:
//
// {
//     file: {name: 'filename'}
//   , blah: 'bleh'
// }

imaginaryObjectStream.pipe(dps('file.name')).pipe(process.stdout)
// => 'filename'
imaginaryObjectStream.pipe(dps('blah')).pipe(process.stdout)
// => 'bleh'

API

dps(dotPath, _fallback) -> TransformStream

Looks up dotPath property on whatever object is written to it and streams result. In the event of that property being absent or otherwise undefined, fallback is streamed instead if provided.

license

MIT

2.0.1

9 years ago

2.0.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.0

10 years ago