
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.
buffered-spawn
Advanced tools
Buffered child_process#spawn.
$ npm install buffered-spawn
In terms of arguments, they are equal to node's spawn.
const bufferedSpawn = require('buffered-spawn');
// Callback style
bufferedSpawn('git', ['clone', 'git@github.com/bower/bower'], { cwd: '.' }, (err, stdout, stderr) => {
if (err) {
// Both stdout and stderr are also set on the error object
return console.error(`Command failed with error code of #${err.status}`);
}
console.log(stdout);
console.log(stderr);
});
// ...or Promise style
bufferedSpawn('git', ['clone', 'git@github.com/bower/bower'], { cwd: '.' })
.then((output) => {
console.log(output.stdout);
console.log(output.stderr);
}, (err) => {
// Both stdout and stderr are also set on the error object
console.error(`Command failed with error code of #${err.status}`);
});
The actual child process is available if necessary:
const buffspawn('buffered-spawn');
// Callback style
const cp = buffspawn('git', ['clone', 'git@github.com/bower/bower'], () => {}};
// ...or Promise style
const promise = buffspawn('git', ['clone', 'git@github.com/bower/bower']);
const cp = promise.cp;
As said before, buffered-spawn
uses cross-spawn
to actually spawn the process. If you are having trouble running Windows such as wmic which has its own arguments parser, you may disable like so:
const cp = buffspawn('wmic', [
'logicaldisk', 'where', 'DeviceID="Z:"',
'get' 'freeSpace,size'
], { crossSpawn: false }, () => {}};
$ npm test
Released under the MIT License.
FAQs
Buffered child process#spawn.
The npm package buffered-spawn receives a total of 30,574 weekly downloads. As such, buffered-spawn popularity was classified as popular.
We found that buffered-spawn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.