Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
An easy to use wrapper around child_process.spawn
, useful for Cakefiles and the like. Pipes stdout
, stderr
and stdin
so you don't have to. Think of it as a streaming child_process.exec
with a few extra goodies.
var exec = require('executive');
exec('ls', function(err, out, code) {
// Done, no need to echo out as it's piped to stdout by default.
});
Also supports simple serial execution of commands:
var exec = require('executive');
exec(['ls', 'ls', 'ls'], function(err, out, code) {
// All three ls commands are called in order.
});
In the case of a failure, no additional commands will be executed by default.
exec(['ls', 'aaaaa', 'ls'], function(err, out, code) {
// Only the first command succeeds, the last is never called.
});
Arguments are parsed out properly for you:
var exec = require('executive');
exec('ls -AGF Foo\\ bar', function(err, out, code) {
// Note the escaped folder name.
});
If you'd prefer not to pipe stdin
, stdout
, stderr
, or turn continue executing commands on failure:
var exec = require('executive');
exec(['ls', 'aaaaa', 'ls'], {quiet: true, safe: false}, function(err, out, code) {
// Not a peep is heard, and both ls commands will be executed.
});
You even do whatever you want with the child process object:
var exec = require('executive');
child = exec('ls', {quiet: true});
child.stdout.on('data', function(data) {
console.log(data.toString());
});
It's especially nice to use in a Cakefile:
exec = require 'executive'
task 'package', 'Package project', ->
exec '''
mkdir -p dist
rm -rf dist/*
cp manifest.json dist
cp -rf assets dist
cp -rf lib dist
cp -rf views dist
zip -r package.zip dist
rm -rf dist
'''.split '\n'
FAQs
Elegant command execution with built-in control flow
The npm package executive receives a total of 1,034 weekly downloads. As such, executive popularity was classified as popular.
We found that executive 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.