Socket
Book a DemoInstallSign in
Socket

dotpath-stream

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotpath-stream

transform object streams by dotpath

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

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

Keywords

stream

FAQs

Package last updated on 17 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts