Gear.js - Node.js 构建系统


BSD
跨平台
JavaScript

软件简介

Gear 是易用,方便扩展,强大的 Node.js 和浏览器构建系统。

主要特性:

  • 可以结合接触构建块来执行复杂的构建

  • 任务可以简单定义,保持极其简单的系统内部

  • 异步执行

  • 通过 NPM,文件或者目录扩展任务加载

  • 为复杂任务执行提供高级流控制

  • 可以在 Node.js 和浏览器中运行

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();