
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.
streams-set
Advanced tools
Maintain a set of open streams
npm install streams-set
var streamsSet = require('./')
var net = require('net')
var activeSockets = streamsSet()
var server = net.createServer(function (socket) {
// when the socket ends/errors it will automatically be removed from the set
activeSockets.add(socket)
// will print "set size is 1"
console.log('set size is', activeSockets.size)
socket.on('close', function () {
// will print "set size is 0"
console.log('set size is', activeSockets.size)
})
})
server.listen(10000, function () {
var socket = net.connect(10000)
// connect and destroy
socket.on('connect', function () {
socket.destroy()
})
})
var set = streamsSet()Create a new set
set.add(stream)Add a stream to the set. If the stream ends/errors it will be removed from the set
set.remove(stream)Manually remove a stream from the set
set.has(stream)Check if a stream is in the set
set.streamsAn array of streams in the set
set.sizeThe current size of the set
set.forEach(fn)Iterate over all streams in the set
stream = set.get(index)Get a stream from the set
MIT
FAQs
Maintain a set of open streams
We found that streams-set 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.