Vo is a control flow library for minimalists.
Features
- Seamlessly supports promises, generators, synchronous & asynchronous functions.
- Vo is composable, allowing you to intuitively orchestrate complex work flows
- Easily catch and fix errors anywhere in the pipeline
- Returns a promise that you can yield on or "await"
- Supports both stack and pipeline task flow
- Tiny (4kb minified + gzip)
- Browser & server support
- Well-tested
Installation
- Node.js or Browserify:
npm install vo
- Standalone: vo.js & vo.min
Getting Started
An updated guide will be available soon. For now, take a look at the tests for now.
Vo Runtime
Now you can run generators top-level with the runtime:
index.js
var res = yield superagent.get('http://google.com')
console.log(res.status)
return res.status
vo index.js // 200
Things to keep in mind
Binding a generator function isn't consistently implemented yet
function * a () {
}
vo(a.bind(ctx))
The following will work on node 5 and latest chrome, but not on latest safari or node 4. Latest babel does not fix this problem.
Just to be safe, I'd install co-bind and do this instead:
var bind = require('co-bind')
function * a () {
}
vo(bind(a, ctx))
Test
We have a comprehensive test suite. Here's how you run it:
npm install
make test
License
MIT