Skip to content
Inspects a nodejs stream 2+ and logs the data that's coming through.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example
test
.gitignore
.travis.yml
LICENSE
README.md
inspect-stream.js
package.json

README.md

inspect-stream build status

Inspects a nodejs stream 2+ and logs the data that's coming through.

var objects = require('stream-spectrum/readable/object') 
  , tarpit = require('stream-spectrum/writable/tarpit')
  , inspect = require('inspect-stream')

objects({ from: 1, to: 3 })
  .pipe(inspect())
  .pipe(tarpit({ objectMode: true }));
{ foo: 'bar',
  beep: { boop: 'beep-boop' },
  count: 1 }
{ foo: 'bar',
  beep: { boop: 'beep-boop' },
  count: 2 }
{ foo: 'bar',
  beep: { boop: 'beep-boop' },
  count: 3 }

Installation

npm install inspect-stream

API

*function inspect(depthOrLog)

Creates a transform stream that will log the data coming through and push it downstream.

@name exports @function params:

  • depthOrLog Number|Function allows to override the log inspect depth or replace the log function entirely.

returns:

TransformStream that behaves like the upstream.

License

MIT

Something went wrong with that request. Please try again.