
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
stream-observer
Advanced tools
Listen for data events on a readable stream without triggering flowing mode
Listen for data events on a readable stream without triggering flowing
mode.
Normally a readable stream will start to emit data events (i.e. enter
"flowing mode") right after you attach the first data event listener.
But sometimes it's desirable to attach a data event listener without
the side effect of enabling flowing mode.
E.g. if you want to subscribe to the content of a stream but are not in
charge of when the stream starts flowing - say for instance if you hand
the stream off to someone else that are not attaching their own data
event listener right away.
This module gives you that ability.
npm install stream-observer --save
const fs = require('fs')
const streamObserver = require('stream-observer')
const stream = fs.createReadStream(__filename)
// Register observer to listen for data events once the stream starts
// flowing. Callback will be called with the data chunks.
streamObserver(stream, function (chunk) {
console.log(`stream produced ${chunk.length} bytes of data`)
})
// Wait a little before starting to read data from the stream.
setTimeout(function () {
stream.pipe(process.stdout)
}, 1000)
fn = streamObserver(stream, callback)Arguments:
stream - the readable stream you wish to observecallback - the callback will be attached to the data event of the
stream without triggering flowing modeReturns a function that you can call if you want to observer to stop observing.
FAQs
Listen for data events on a readable stream without triggering flowing mode
We found that stream-observer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.