0.0.1 • Published 11 years ago

yao v0.0.1

Weekly downloads
1
License
-
Repository
-
Last release
11 years ago

Compatible to all gulp plugins.

Installaction

$ npm install -g yao
var jshint = require('gulp-jshint');

module.exports = function *(Yao) {
  var yao = Yao.create('yao');

  yao.task('lint', function *() {
    yao.interrupt('lint', this);
    return yao.src(['lib/**/*.js'])
      .pipe(jshint('.jshintrc'))
      .pipe(jshint.reporter('default'));
  });

  yao.task('watch-js', function *() {
    yield yao.run('lint');
    yao.watch('lib/**/*.js', ['lint']);
  });

  yao.task('default', ['lint']);
  yao.task('watch', ['watch-js']);

  return yao;
};

API

.task(name, GeneratorFuntion)

.parallel(taskNames)

.series(taskNames)

.run(taskNames, series)

.interrupt(taskName , taskName... , deep)

.mount(yao)

Example

Mount other yaofile

Command line

$ yao -m yaofiles/*.js

JS API

// ...
return function (Yao) {
  var yao = Yao.create('main');
  var yaofile2 = require('./yaofiles/example');
  var yao2 = yield yaofile2(Yao);
  yao.mount(yao2);
};
// ...