
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
grunt-exec
Advanced tools
Grunt plugin for executing shell commands.
Install grunt-exec using npm:
$ npm install grunt-exec
Then add this line to your project's Gruntfile.js:
grunt.loadNpmTasks('grunt-exec');
This plugin is a multi task, meaning that grunt will automatically iterate over all exec targets if a target is not specified.
If the exit code generated by the specified shell command is greater than 0, grunt-exec will assume an error has occurred and will abort grunt immediately.
true
, stdout will be printed. Defaults to true
.true
, stderr will be printed. Defaults to true
.0
. Can be an array
for multiple allowed exit codes.child_process.exec
. Defaults to
a noop.If the configuration is instead a simple string
, it will be
interpreted as a full command itself:
exec: {
echo_something: 'echo "This is something"'
}
If you plan on doing advanced stuff with grunt-exec, you'll most likely be using
functions for the command
property of your exec targets. This section details
a couple of helpful tips about command functions that could help make your life
easier.
Command functions can be called with arbitrary arguments. Let's say we have the following exec target that echoes a formatted name:
exec: {
echo_name: {
cmd: function(firstName, lastName) {
var formattedName = [
lastName.toUpperCase(),
firstName.toUpperCase()
].join(', ');
return 'echo ' + formattedName;
}
}
}
In order to get SIMPSON, HOMER
echoed, you'd run
grunt exec:echo_name:homer:simpson
from the command line.
grunt
objectAll command functions are called in the context of the grunt
object that they
are being ran with. This means you can access the grunt
object through this
.
The following examples are available in grunt-exec's Gruntfile.
grunt.initConfig({
exec: {
remove_logs: {
command: 'rm -f *.log',
stdout: false,
stderr: false
},
list_files: {
cmd: 'ls -l **'
},
list_all_files: 'ls -la',
echo_grunt_version: {
cmd: function() { return 'echo ' + this.version; }
},
echo_name: {
cmd: function(firstName, lastName) {
var formattedName = [
lastName.toUpperCase(),
firstName.toUpperCase()
].join(', ');
return 'echo ' + formattedName;
}
}
}
});
$ cd grunt-exec
$ npm test
Found a bug? Create an issue on GitHub.
https://github.com/jharding/grunt-exec/issues
For transparency and insight into the release cycle, releases will be numbered with the follow format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
For more information on semantic versioning, please visit http://semver.org/.
Copyright (c) 2012 Jake Harding
Licensed under the MIT License.
FAQs
Grunt task for executing shell commands.
The npm package grunt-exec receives a total of 44,583 weekly downloads. As such, grunt-exec popularity was classified as popular.
We found that grunt-exec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.