0.1.2 • Published 10 years ago

asyncify.js v0.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
10 years ago

Asyncify

Makes a function conform to node-style callback convention

Install:

npm install asyncify.js

Usage:

var async = require('async');
require('asyncify');

var doSomeWork = function( t ){
  console.log("doin' work");
  $('.page-title').text( t );
};

async.series([
  console.log.async( console, 1, 2 )
, doSomeWork.async( null, 'Ohyeaaaah' )
, console.log.async().bind( console, 'also, use bind' )
, console.log.async( console, 'complete, ':)' )
]);

// => 1, 2
// => doin' work
// => also, use bind
// => complete :)