
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Call a child process with the ease of exec and safety of spawn
This module provides the best of both worlds of spawn
and exec
It will callback with 2 strings containing stdout and stderr
(like child_process.exec
), but will take an array of process arguments
(like child_process.spawn
) to avoid any potentially harmful shell expansion.
var exec = require('exec');
var exec = require('exec');
exec(['ls', '-lha'], function(err, out, code) {
if (err) throw err;
process.stdout.write(out);
process.exit(code);
});
The example above will call ls -lha
safely, by passing the arguments directly
to exec(2) without using an shell expansion/word splitting.
It returns a child_process.spawn
object, and callbacks with any stdout,
stderr, and the exit status of the command. The above example will throw an
error if any stderr was produced, otherwise it will print the stdout
and exit with the exit code of ls
.
opts
is additional options to pass to child_process.spawn
npm install exec
MIT
FAQs
Call a child process with the ease of exec and safety of spawn
The npm package exec receives a total of 9,120 weekly downloads. As such, exec popularity was classified as popular.
We found that exec 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
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.