index.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 'use strict';
  2. var inherits = require('util').inherits;
  3. var EventEmitter = require('events').EventEmitter;
  4. var DefaultRegistry = require('undertaker-registry');
  5. var tree = require('./lib/tree');
  6. var task = require('./lib/task');
  7. var series = require('./lib/series');
  8. var lastRun = require('./lib/last-run');
  9. var parallel = require('./lib/parallel');
  10. var registry = require('./lib/registry');
  11. var _getTask = require('./lib/get-task');
  12. var _setTask = require('./lib/set-task');
  13. function Undertaker(customRegistry) {
  14. EventEmitter.call(this);
  15. this._registry = new DefaultRegistry();
  16. if (customRegistry) {
  17. this.registry(customRegistry);
  18. }
  19. this._settle = (process.env.UNDERTAKER_SETTLE === 'true');
  20. }
  21. inherits(Undertaker, EventEmitter);
  22. Undertaker.prototype.tree = tree;
  23. Undertaker.prototype.task = task;
  24. Undertaker.prototype.series = series;
  25. Undertaker.prototype.lastRun = lastRun;
  26. Undertaker.prototype.parallel = parallel;
  27. Undertaker.prototype.registry = registry;
  28. Undertaker.prototype._getTask = _getTask;
  29. Undertaker.prototype._setTask = _setTask;
  30. module.exports = Undertaker;