
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
stream-stack
Advanced tools
Stream instances into stackable, protocol-based streams.This module exposes the StreamStack interface, which starts off as a node
Stream subclass that accepts a "parent" Stream to work with. StreamStack is
meant to be subclassed in order to implement the layers of a protocol, or run the
parent Stream's data through some kind of filter (i.e. compression).
By default, a StreamStack instance proxies all events downstream (from the
parent stream to the child stream), and proxies all functions calls upstream
(from the child stream to the parent stream).
Keeping the StreamStack subclass' implementation independent of the parent
Stream instance allows for the backend transport to be easily swapped out
for flexibility and code re-use. For example, storing netcat results to a file,
and using fs.ReadStream as your parent stream, rather than net.Stream, in your
test cases.
Since StreamStack inherits from the regular node Stream, all it's prototypal
goodies can be used along with your subclass instances. This makes it extremely
easy for you to call Stream#pipe(writable), in order to utilize node's data
transfer philosophies.
Here's a simple, kinda silly example:
var util = require('util');
var StreamStack = require('stream-stack').StreamStack;
// The first argument is the parent stream
function DoubleWrite(stream) {
StreamStack.call(this, stream);
}
util.inherits(DoubleWrite, StreamStack);
// Overwrite the default `write()` function to call
// write() on the parent stream twice!
DoubleWrite.prototype.write = function(data) {
this.stream.write(data);
this.stream.write(data);
}
// How to Use:
var doubleStdout = new DoubleWrite(process.stdout);
doubleStdout.write("this will be printed twice!\n");
We've defined a DoubleWrite class. It accepts a writable stream, and
whenever write() is called on the DoubleWrite instance, then in return
write() get called twice on the parent stream. In this example, our
writable stream, process.stdout, will get the string printed to it twice.
Check out the Wiki page to see the list of Known Subclasses.
FAQs
Filter low-level `Stream` instances into stackable, protocol-based streams.
We found that stream-stack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.