Skip to content

Commit

Permalink
Inputs could be records or objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanyan committed Mar 30, 2014
1 parent a08e3e3 commit f8bb72d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -4,13 +4,13 @@ Task/1.0
> JavaScript Task Specification
Task is unit of execution. In the javascript world, there have existing hundreds of tasks that we can use,
like `jshint`, `csslint`, `uglifyjs`, `jade`, `jasmine`, etc. But they are all unconnected, this specification addresses how tasks should be written in order to be connected that can be both client and server side.
like `coffee-script`, `sass`, `less`, `jade`, `haml`, `uglifyjs`, `cleancss`, `jshint`, `csslint`, `jasmine`, etc. But they are all unconnected, this specification addresses how tasks should be written in order to be connected that can be both client and server side.

## 1. Terminology

1. `task` is an object or function with a `run` method whose behavior conforms to this specification.
2. `thenable` is an object or function that defines a `then` method.
3. `records` is array of [Record](https://github.com/node-task/record) instances.
3. `inputs` is an array of [Record](https://github.com/node-task/record) instances or javascript objects.
4. `logger` is a `Logging` object, default is `console`.

## 2. Requirements
Expand All @@ -19,17 +19,17 @@ like `jshint`, `csslint`, `uglifyjs`, `jade`, `jasmine`, etc. But they are all u
A task must provide a `run` method must returning a `thenable`. A task’s `run` method accepts three arguments, and all arguments are optional:

```js
run([records [, options [, logger]]])
run([inputs [, options [, logger]]])
```

Within Common.JS modules ecosystem, the entry point module like `index.js` should exports `run` method:

```js
// index.js
exports.run = function(records, options, logger){
exports.run = function(inputs, options, logger){
return new Promise(function(resolve, reject){
logger.log("it's work")
resolve(records);
resolve(inputs);
})
}
```
Expand Down

0 comments on commit f8bb72d

Please sign in to comment.