Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/inspect-stream
Inspects a nodejs stream 2+ and logs the data that's coming through.
https://github.com/thlorenz/inspect-stream
Last synced: 15 days ago
JSON representation
Inspects a nodejs stream 2+ and logs the data that's coming through.
- Host: GitHub
- URL: https://github.com/thlorenz/inspect-stream
- Owner: thlorenz
- License: mit
- Created: 2013-10-03T10:24:03.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-03T12:09:26.000Z (about 11 years ago)
- Last Synced: 2024-10-18T01:29:32.259Z (20 days ago)
- Language: JavaScript
- Homepage:
- Size: 109 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# inspect-stream [![build status](https://secure.travis-ci.org/thlorenz/inspect-stream.png)](http://travis-ci.org/thlorenz/inspect-stream)
Inspects a nodejs stream 2+ and logs the data that's coming through.
```js
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