0.0.4 • Published 10 years ago

great v0.0.4

Weekly downloads
42
License
MIT
Repository
github
Last release
10 years ago

great

Another task runner with js

great vs gulp vs grunt

Great compared to major Task Runners (or Build Systems)

 greatgulpgrunt
OrientingDataFileFile
FlowClearClearMess
EasyYesNoNo

great vs nodeunit vs mocha

Great compared to major Test Frameworks

 greatnodeunitmocha
Test OnlyNoYesYes
Event DrivenYesNoNo
NestedGoodBadGood
BrowserGoodBadBad

Quick Look

A task file to load:

module.exports = function() {
  // upward emitting
  this.emit('log', 'example: run');

  // downward capturing
  this.capture('title', function (title) {
    this.emit('log', 'titled: ' + title);
    this.set('title', title);
  });
  this.capture('end', function () {
    this.emit('log', 'ended: ' + this.get('title'));
  });

  // task loading
  this.add(function () {
    this.emit('title', 'series');
    this.add(createBody('a-1'));
    this.add(createBody('a-2'));
    this.add(createBody('a-3'));
  });
  this.add(function () {
    this.emit('title', 'parallel');
    this.add([
      createAsyncBody('b-1'),
      createAsyncBody('b-2'),
      createAsyncBody('b-3'),
      createAsyncBody('b-4'),
      createAsyncBody('b-5'),
      createAsyncBody('b-6')
    ]);
  });
};

Greatfile.js for entry:

var great = require('great');
var args = process.argv.slice(2);
great(function () {
  // task picking
  if (args[0] === 'example') {
    this.add(require('./example/' + args[1]));
  }
});

Run tasks from command line:

node Greatfile [arg1] [arg2] ..`

Or after alias great='node Greatfile':

great [arg1] [arg2] ..

Also this way on browser:

<!-- include great.js -->
<script src="great.js"></script>

<!-- define tasks -->
<script src="task1.js"></script>
<script src="task2.js"></script>

<!-- configure tasks -->
<script>
  great(function() {
    this.add(task1);
    this.add(task2);
  });
</script>

See for more:

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago