Skip to content

Commit

Permalink
Preliminary Node API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
unconed committed May 25, 2011
1 parent 1f4f5b4 commit 90f6657
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Node-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
```
exports.main = function (tokens, pipes, exit) {
exit(true); // Success
exit(false); // Error
exit(true, { ... }); // Success with meta data.
};
```

Expand All @@ -20,7 +23,7 @@ exports.main = function (tokens, pipes, exit) {

`pipes` is an object with the 5 TermKit pipes: Data In/Out, View In/Out, and Error Out.

`exit` is a function to call when ending the process. This call can be nested inside asynchronous closures.
`exit` is a function to call when ending the process. This call can be nested inside asynchronous closures. Pass `true` for success, `false` for error. You can pass out additional meta-data in the second argument, though this is currently not used for anything.

## Pipes

Expand Down

0 comments on commit 90f6657

Please sign in to comment.