All Projects → teppeis → Grunt Parallelize

teppeis / Grunt Parallelize

Licence: mit
Make your task parallel.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Grunt Parallelize

Awesome Cms Core
Awesome CMS Core is an open source CMS built using ASP.Net Core & ReactJS with module seperation concern in mind and provide lastest trend of technology like .Net Core, React, Webpack, SASS, Background Job, Message Queue.
Stars: ✭ 352 (+334.57%)
Mutual labels:  grunt
Flow theme
OXID Flow Responsive Theme
Stars: ✭ 24 (-70.37%)
Mutual labels:  grunt
Mathjax Grunt Cleaner
A grunt file to reduce the footprint of a MathJax installation
Stars: ✭ 42 (-48.15%)
Mutual labels:  grunt
Lein template descjop
A Leiningen template(Clojure/ClojureScript Project) for Web based desktop application with Electron (atom-shell).
Stars: ✭ 394 (+386.42%)
Mutual labels:  grunt
Instantbootstrap
Instant Bootstrap is a quick and easy way to start creating bootstrap themes using LESS, SASS, GRUNT, and BOWER.
Stars: ✭ 5 (-93.83%)
Mutual labels:  grunt
Hive Framework
A website development framework built with Sass, and incorporating jQuery UI.
Stars: ✭ 14 (-82.72%)
Mutual labels:  grunt
Grunt Php
Start a PHP server
Stars: ✭ 291 (+259.26%)
Mutual labels:  grunt
Grunt2gulp.js
Converts Grunt task files, gruntfile.js, to Gulp files.
Stars: ✭ 64 (-20.99%)
Mutual labels:  grunt
Opml2indesign
The XSLT which convert an OPML file to InDesign importable XML
Stars: ✭ 6 (-92.59%)
Mutual labels:  grunt
Grunt Md2html
Small Grunt MultiTask to convert Markdown files to HTML, supporting Grunt >= 1.0.0
Stars: ✭ 37 (-54.32%)
Mutual labels:  grunt
Assemble
Community
Stars: ✭ 3,995 (+4832.1%)
Mutual labels:  grunt
Grunt Responsive Images
Produce images at different sizes for responsive websites.
Stars: ✭ 726 (+796.3%)
Mutual labels:  grunt
Docker Compose Nodejs Examples
Finally some real world examples on getting started with Docker Compose and Nodejs
Stars: ✭ 944 (+1065.43%)
Mutual labels:  grunt
Kc3kai
Kantai Collection Game Viewer and Tools
Stars: ✭ 387 (+377.78%)
Mutual labels:  grunt
Grunt Frontend Workflow
Structured, modular and test-driven front-end development and build workflow with Grunt task runner. Includes boilerplate code for Backbone with single/multipage RequireJS setup, and a RESTful API for prototyping.
Stars: ✭ 44 (-45.68%)
Mutual labels:  grunt
Grunt Ts
A grunt task to manage your complete typescript development to production workflow
Stars: ✭ 317 (+291.36%)
Mutual labels:  grunt
Grunt Csswring
DEPRECATED. Minify CSS files using PostCSS-based CSSWring
Stars: ✭ 12 (-85.19%)
Mutual labels:  grunt
Grunt Menu
Useful menu interface for listing/executing your configured tasks
Stars: ✭ 79 (-2.47%)
Mutual labels:  grunt
Phplint
Lightning fast concurrent PHP linter for Node.js, Grunt & Gulp! ⚡️
Stars: ✭ 62 (-23.46%)
Mutual labels:  grunt
Grunt Javascript Obfuscator
Obfuscates JavaScript files using amazing javascript-obfuscator.
Stars: ✭ 34 (-58.02%)
Mutual labels:  grunt

grunt-parallelize

Make your task parallel.

NPM version Node.js version support build status Dependency Status MIT License

This plugin divides src files of your task and executes them in parallel.

If your task has too many src files and it's CPU intensive like JSHint, this plugin reduces your build time significantly.

Before (36sec to jshint 1640 files)

Before

Parallelize! (14sec to jshint 1640 files by 4 parallel)

Parallelize!

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide. Then you can install this plugin to your project with:

$ npm install grunt-parallelize --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-parallelize');

In your project's Gruntfile, add a section named parallelize to the data object passed into grunt.initConfig().

grunt.initConfig({
  jshint: {
    all: {
      src: './**/*.js'
    }
  },
  parallelize: {
    jshint: {
      // Run jshint:all task with 2 child processes in parallel.
      all: 2
    },
  },
});

And just prefix parallelize: to your task name.

# Normal single process
$ grunt jshint:all
Running "jshint:all" (jshint) task
>> 101 files lint free.

Done, without errors.

# Parallelize!
$ grunt parallelize:jshint:all
Running "parallelize:jshint:all" (parallelize) task
    
    Running "jshint:all" (jshint) task
    >> 51 files lint free.
    
    Done, without errors.
    
    Running "jshint:all" (jshint) task
    >> 50 files lint free.
    
    Done, without errors.
    
Done, without errors.

Why grunt-parallelize?

There are concurrent or parallel processing grunt plugins like grunt-concurrent or grunt-parallel. They execute different tasks in parallel, but this plugin divides a task into multi processes.

Configuration

Options

options.processes

Type: Number

A number of processes.

This is equivalent with the above.

  parallelize: {
    options: {
      processes: 2
    },
    jshint: {
      all: true
    },
  },

Files format

grunt-parallelize supports all Grunt standard files formats.

Only src

If only src is specified, the src files are devided per each process.

grunt.initConfig({
  jshint: {
    all: {
      src: ['src/1.js', 'src/2.js', 'src/3.js']
    }
  },
  parallelize: {
    jshint: {
      all: 2
    },
  },
});

=> parallelized as:

  • Process 1: src/1.js and src/2.js
  • Process 2: src/3.js

Both src and dest

If dest is specified, the dest files are devided per each process.

grunt.initConfig({
  concat: {
    all: {
      files: [
        {src: ['src/1.js', 'src/2.js'], dest: 'dest/1.js'},
        {src: ['src/3.js', 'src/4.js'], dest: 'dest/2.js'},
        {src: ['src/5.js'], dest: 'dest/3.js'},
      ],
    }
  },
  parallelize: {
    jshint: {
      all: 2
    },
  },
});

=> parallelized as:

  • Process 1: dest/1.js (including 'src/1.js' and 'src/2.js') and dest/2.js (including 'src/3.js' and 'src/4.js')
  • Process 2: dest/3.js (including 'src/5.js')

Thanks

This plugin is inspired by sindresorhus's grunt-concurrent. Thanks!

Changelog

  • 2016-04-08 v1.1.7 Fix peerDependencies #31
  • 2016-04-07 v1.1.6 Use [email protected] for internal test #30
  • 2016-03-21 v1.1.5 Update dependencies
  • 2016-03-16 v1.1.4 Support [email protected] #24
  • 2015-11-05 v1.1.3 Cleanup tmp files #21
  • 2015-11-05 v1.1.2 Change internal file format #22
  • 2015-11-05 v1.1.1 Update deps #20
  • 2015-03-23 v1.1.0 Support all file formats and dest. Fix ENAMETOOLONG #13
  • 2015-02-07 v1.0.1 Update dependencies, test with Node.js v0.12
  • 2013-12-23 v1.0.0 Update dependencies
  • 2013-11-22 v0.1.1 Replace deprecated grunt.util methods in grunt-0.4.2
  • 2013-09-09 v0.1.0 First release

License

MIT License: Teppei Sato <[email protected]>

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].