
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
duplex-stream
Advanced tools
Composable streams. Present a distinct readable stream and a distinct writable stream as a single Stream for reading/writing.
Composes two distinct readable and writable streams into one cohesive Stream. Why would you want to do this? I honestly have no idea. You'd have to be really stupid or something.
npm install duplex-stream
var DuplexStream = require("duplex-stream");
var myDuplexStream = new DuplexStream(aReadableStream, aWritableStream);
The DuplexStream should behave exactly how you'd expect.
// Probably because of this:
console.log((new DuplexStream()) instanceof Stream); // -> true
That is, when events occur on the underlying streams, they occur on the DuplexStream.
data
event is emitted on DuplexStreamend
event occurs on underlying readable, DuplexStream marks itself as unreadable but can still be written to (if it's not already been ended).destroySoon()
on the duplex stream will destroy readable stream immediately and tell writable stream to destroy as soon as it can.One little "gotcha" though, close
won't be emitted on the DuplexStream until both underlying streams are closed.
DuplexStream is just a silly little convenience. An (unnecessary) abstraction. I use it for composing automated tests that deal with Streams, along with my node-stream-buffer project.
FAQs
Composable streams. Present a distinct readable stream and a distinct writable stream as a single Stream for reading/writing.
We found that duplex-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.