
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
grunt-shell-spawn
Advanced tools
A fork of sindresorhus's grunt-shell with support for background processes.
(e.g.: start a
compass watch
in the background)
This plugin lets you:
npm install grunt-shell-spawn --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with:
grunt.loadNpmTasks('grunt-shell-spawn');
Let's take for example launching a compass watch
in background:
shell: {
command: 'compass watch',
options: {
async: true
}
}
shell: {
compassWatch: {
command: 'compass watch',
options: {
async: true,
execOptions: {
cwd: './src/www/'
}
}
},
coffeeCompile: {
command: 'coffee -b -c -o /out /src',
options: {
async: false,
execOptions: {
cwd: './src/www/'
}
}
},
options: {
stdout: true,
stderr: true,
failOnError: true
}
}
Works in synchronous or asynchronous mode.
asyncWithCallbacks: {
command: 'sleep 3 & echo HELLO & sleep 1 & echo WORLD & sleep 2',
options: {
async: true,
stdout: function(data) { /* ... */ },
stderr: function(data) { /* ... */ },
callback: function(exitCode, stdOutStr, stdErrStr, done) {
done();
}
}
},
Stop a running async task with the :kill
task argument.
server: {
command: 'redis-server',
options: {
async: true,
}
},
grunt shell:server shell:somethingElse shell:server:kill
The process will be killed with a SIGKILL.
Please note that processes that are not killed will continue running even after grunt finishes, unless explicitly terminated using :kill
. This means it is required to use :kill
to clean up any processes you started, unless you want them to continue running in the background.
MIT License (c) Sindre Sorhus
FAQs
Grunt task to run shell commands
The npm package grunt-shell-spawn receives a total of 5,893 weekly downloads. As such, grunt-shell-spawn popularity was classified as popular.
We found that grunt-shell-spawn demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.