Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
The 'unpipe' npm package is designed to remove or detach a stream from a pipeline. This can be particularly useful in scenarios where you need to gracefully handle stream errors or manipulate the flow of data dynamically. It provides a straightforward API to unpipe streams, which can be beneficial in creating more robust and error-resilient streaming applications.
Unpipe a stream
This code demonstrates how to use 'unpipe' to detach a stream when an error occurs. It's useful for preventing memory leaks or unintended data processing after an error.
const unpipe = require('unpipe');
const stream = getSomeReadableStream();
stream.on('error', function(err) {
unpipe(stream);
});
The 'pump' package is similar to 'unpipe' in that it is used to safely pipe streams together, handling cleanup and errors gracefully. Unlike 'unpipe', which is focused on detaching streams, 'pump' provides a more comprehensive solution for creating and managing stream pipelines, including the ability to safely clean up after streams have ended or errored.
While 'through2' is not directly similar to 'unpipe' in functionality, it offers a simplified wrapper around Node's stream.Transform. It's useful for creating transform streams easily. In comparison, 'unpipe' specifically deals with detaching streams, whereas 'through2' is more about stream creation and transformation.
Unpipe a stream from all destinations.
$ npm install unpipe
var unpipe = require('unpipe')
Unpipes all destinations from a given stream. With stream 2+, this is
equivalent to stream.unpipe()
. When used with streams 1 style streams
(typically Node.js 0.8 and below), this module attempts to undo the
actions done in stream.pipe(dest)
.
FAQs
Unpipe a stream from all destinations
The npm package unpipe receives a total of 30,174,497 weekly downloads. As such, unpipe popularity was classified as popular.
We found that unpipe 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.