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.
mutate-stream
Advanced tools
Object mutation pipelines for flow control
I think object mode streams are really handy for async flow control:
var stream = require('mutate-stream');
validate(req.body)
.pipe(sanitize())
.pipe(whatever())
.pipe(dbWrite)
This module is a simple wrapper to eliminate boilerplate in a lot of my applications.
Download node at nodejs.org and install it, if you haven't already.
npm install mutate-stream --save
stream(<transform function>, [ optional flush function ]);
Pass in a transform function and an optional flush function. mutate-stream returns a a function that can take an optional data object parameter (to start your pipeline). This function in turn returns a stream.
Example:
var stream = require('mutate-stream');
function foo (obj, encoding, cb) { /* some transform */ }
function bar (obj, encoding, cb) { /* some transform */ }
var fooStream = stream(foo),
barStream = stream(bar);
fooStream({some: 'optional data'})
.pipe(barStream());
npm install
npm test
> mutate-stream@0.0.0 test /Users/mark/projects/mutate-stream
> node test/mutate-stream.js
TAP version 13
# wraps transform function
ok 1 should be equivalent
1..1
# tests 1
# pass 1
# ok
MIT
FAQs
Object mutation pipelines for flow control
We found that mutate-stream 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.