Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vo

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vo

Vo is a control flow library for minimalists

  • 4.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
318
increased by80.68%
Maintainers
1
Weekly downloads
 
Created
Source

img

Vo is a control flow library for minimalists.

What you get

  • new in 4.0 Consistent function signatures
  • Tiny library (4kb minified + gzipped)
  • Supports promises, generators, & sync functions
  • Serial and parallel execution for every flow
  • 2 different kinds of flows: pipeline & stack
  • Easily catch and fix errors anywhere in the pipeline
  • Errors passed as arguments so you know where the failure occurred
  • Returns a promise that you can yield on or "await"
  • Browser & server support
  • Well-tested

Installation

  • Node.js or Browserify: npm install vo
  • Standalone: vo.js & vo.min

Getting Started

Vo supports 2 kinds of asynchronous flows:

  • pipelines: Transformation pipeline. Return values become the arguments to the next function
  • stacks: Express-style. Arguments are passed in at the top and flow through each middleware function

Both of these flows support both parallel and serial execution

Example

function * get (url) {
  return yield fetch(url)
}

function map (responses) {
  return responses.map(res => res.status)
}

vo([
  fetch('https://standupjack.com'),
  fetch('https://google.com')
], map).then(function (statuses) {
  assert.deepEqual([ 200, 200 ])
})

Guide

Coming soon! Check out the comprehensive test suite 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) // 200
vo index.js

FAQ

Binding a generator function isn't implemented consistently yet

Use co-bind just to be safe.

Test

We have a comprehensive test suite. Here's how you run it:

npm install
make test

License

MIT

Keywords

FAQs

Package last updated on 28 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc