Package Exports
- just-tasks
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (just-tasks) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
jsut-tasks
just-tasks is a very simple module to run 'tasks'. In essence it's just a rename of node's own EventEmitter interface, with semantics to match its function.
Installation
node install just-tasksUsage
The module just renames the event emitter's default methods so you can use the following:
TaskRunner.task(name, function): Create a new task with the specified name (alias ofEventEmitter'son)TaskRunner.taskOnce(name, function): Create a new single use task with the specified name (alias ofEventEmitter'sonce)TaskRunner.run(name[, args]): Run the task with the specified name and the given arguments (alias ofEventEmitter'semit)
Example
var TaskRunner = require('just-tasks');
// Create a new task
TaskRunner.task('print.welcome', function(name) {
console.log('Welcome, %s!', name);
});
// Now, maybe from somewhere else (TaskRunner is a singleton), run the task
TaskRunner.run('print.welcome', 'Michael');Of course you can also use callbacks as you're used to in node.
License
Copyright 2015 Michiel van der Velde.
This software is licensed under the MIT License.