Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Gear.js - Build System for Node.js and the Browser
branch: master

This branch is 103 commits behind yahoo:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
build
lib
test
vendor
.gitignore
LICENSE
Makefile
README.md
bootstrap.js
index.js
package.json

README.md

Gear.js

Task-Based Build System

Gear.js is a scriptable build system using simple tasks that act like a sequence of piped commands.

Features include:

  • Runs in Node and the browser.
  • Basic building blocks that can be combined to perform complex builds.
  • Tasks are simply defined and keep system internals to a minimum.
  • Asynchronous execution.
  • Extensible task loading via NPM, file, or directory.
  • Advanced flow control for complex task execution.

Installation

To get the most out of Gear.js, you will want to install gear-lib which contains tasks for linting, minifying, and deploying JS/CSS assets.

$ npm install gear
$ npm install gear-lib

Quick Examples

Chaining Tasks

new Queue()
 .read('foo.js')
 .log('read foo.js')
 .inspect()
 .write('foobarbaz.js')
 .run();

Execute Tasks Using Array Style

new Queue()
 .read(['foo.js', {name: 'bar.js'}, 'baz.js'])
 .log('read foo.js')
 .inspect()
 .write(['newfoo.js', 'newbar.js']) // Not writing 'baz.js'
 .run();

Parallel Task Execution

new Queue()
 .read('foo.js')
 .log('Parallel Tasks')
 .tasks({
    read:     {task: ['read', ['foo.js', 'bar.js', 'baz.js']]},
    combine:  {requires: 'read', task: 'concat'},
    minify:   {requires: 'combine', task: 'jsminify'},
    print:    {requires: 'minify', task: 'inspect'}, // Runs when read, combine, and minify complete
    parallel: {task: ['log', "Hello Gear.js world!"]} // Run parallel to read
 }).run();
Something went wrong with that request. Please try again.