
Product
Introducing Custom Tabs for Org Alerts
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.
stream-channels
Advanced tools
Simple one-way stream multiplexer with very few features. For two-way (full duplex) multiplexing see the multiplex module.
npm install stream-channels
var channels = require('stream-channels')
var stream = channels()
stream.on('channel', function (channel) {
console.log('new channel')
channel.on('data', console.log)
channel.on('end', function () {
console.log('(no more data)')
})
})
var ch1 = stream.createChannel()
var ch2 = stream.createChannel()
ch1.write('hello')
ch2.write('world')
ch1.end()
ch2.end()
stream.pipe(stream)
var stream = channels([options], [onchannel])Create a new instance. Options include:
{
limit: maxChannelsAllowedOpen // defaults to 1024
}
var writeableStream = stream.createChannel()Create a new channel.
stream.on('channel', readableStream)Emitted when a remote creates a new channel. Will emit the data the remote writes to it.
stream.setTimeout(ms, [ontimeout])Emit a timeout when if the stream is inactive for ~ms milliseconds. Will start a heartbeat as well.
The wire protocol is as follows.
------------------------------
| length | channel-id | data |
------------------------------
Channels are lazily opened., The first time you receive data on a channel id, that channel is opened. Receiving an empty data buffer indicates that the channel is closed.
Messages received with length 0 should be ignored and can be used as a keep alive signal.
Back pressure will trigger on all channels when the slowest channel starts to back pressure.
MIT
FAQs
Simple one-way stream multiplexer with very few features
We found that stream-channels 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.

Product
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.