Socket
Socket
Sign inDemoInstall

grunt-parallel

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-parallel - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

38

Gruntfile.js

@@ -25,19 +25,25 @@ module.exports = function(grunt) {

parallel: {
assets: [{
mix: {
tasks: [{
grunt: true,
args: ['fast']
}, {
grunt: true,
args: ['block']
}, {
cmd: 'pwd'
},{
grunt: true,
args: ['fast']
}]
},
shell: {
tasks: [{
cmd: 'whoami'
}]
},
grunt: {
grunt: true,
args: ['fast']
}, {
grunt: true,
args: ['block']
},{
grunt: true,
args: ['fast']
}],
fail: [{
grunt: true,
args: ['fast']
}, {
grunt: true,
args: ['fail']
}]
tasks: ['fast', 'block', 'fast']
}
}

@@ -44,0 +50,0 @@ });

{
"name": "grunt-parallel",
"description": "Run tasks or commands in child processes.",
"version": "0.0.3",
"version": "0.1.0",
"homepage": "https://github.com/iammerrick/grunt-parallel",

@@ -36,4 +36,6 @@ "author": {

"dependencies": {
"q": "~0.8.12"
"q": "~0.8.12",
"grunt": "~0.4.1",
"lpad": "~0.1.0"
}
}

@@ -21,3 +21,3 @@ # grunt-parallel

* <tt>commands</tt> - An array of commands to run, each deferred to: http://gruntjs.com/api/grunt.util#grunt.util.spawn
* <tt>tasks</tt> - An array of commands to run, each deferred to: http://gruntjs.com/api/grunt.util#grunt.util.spawn

@@ -27,11 +27,28 @@ ```javascript

parallel: {
assets: [{
assets: {
tasks: [{
grunt: true,
args: ['requirejs']
}, {
grunt: true,
args: ['compass']
},{
cmd: 'some-custom-shell-script.sh'
}]
}
}
});
```
#### Only Using Grunt
If you are only going to delegate to other grunt tasks you can simply put `grunt: true` in your tasks configuration and grunt-parallel will run them all using grunt.
```javascript
grunt.initConfig({
parallel: {
assets: {
grunt: true,
args: ['requirejs']
}, {
grunt: true,
args: ['compass']
},{
cmd: 'some-custom-shell-script.sh'
}]
tasks: ['fast', 'block', 'fast']
}
}

@@ -38,0 +55,0 @@ });

@@ -11,2 +11,3 @@ /*

var Q = require('q');
var lpad = require('lpad');

@@ -19,13 +20,9 @@ function spawn(task) {

var message = result.stderr || result.stdout;
grunt.log.error(message);
if (error.message) {
grunt.log.error(error.message);
}
return deferred.reject();
}
grunt.log.writeln(result.toString('ascii'));
grunt.log.writeln('\n' + result);

@@ -39,6 +36,19 @@ deferred.resolve();

grunt.registerMultiTask('parallel', 'Run sub-tasks in parallel.', function() {
lpad.stdout(' ');
var done = this.async();
Q.all(this.data.map(spawn)).then(done, done.bind(this, false));
// If the configuration specifies that the task is a grunt task. Make it so.
if (this.data.grunt === true) {
this.data.tasks = this.data.tasks.map(function(task) {
return {
args: task,
grunt: true
}
});
}
Q.all(this.data.tasks.map(spawn)).then(done, done.bind(this, false)).finally(function() {
lpad.stdout();
});
});
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc