![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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.
});
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
:
var exec = require('executive');
exec(['ls', 'ls'], {quiet: true}, function(err, out, code) {
// Not a peep is heard, and both ls commands will be executed.
});
...or slightly more succint:
exec.quiet(['ls', 'ls'], function(err, out, code) {
// both commands executed
});
In the case of a failure, no additional commands will be executed:
exec(['ls', 'aaaaa', 'ls'], function(err, out, code) {
// Only the first command succeeds, the last is never called.
});
...but you can also choose to ignore errors:
exec(['ls', 'aaaaaa', 'ls'], {safe: false}, function(err, out, code) {
// Both commands execute despite aaaaaa not being a valid executable.
});
If you need to interact with a program, for instance vim, use interactive mode:
exec.interactive('vim', function(err) {
// Edit your commit message or whatnot
});
You even do whatever you want with the child process object:
var exec = require('executive');
child = exec.quiet('ls');
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 584 weekly downloads. As such, executive popularity was classified as not 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.