Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 541 Bytes

README.md

File metadata and controls

28 lines (18 loc) · 541 Bytes

cbw

npm version Build Status

Callback wrapper for cleaner async code. Main benefit is you don't need to write if (err) return cb(err).

Usage

var cbw = require('cbw');

var doSomething = function(cb) {
  getUsers(cbw(cb)(function(users) {
    getArticles(cbw(cb)(function(articles) {
      cb(null, [users, articles]);
    }));
  }));
};

License

MIT