dotpath-stream

transform object streams by dotpath

dotpath-stream

transform object streams by dotpath lookup

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' 

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.

MIT