asfy
v1.0.1
Published
Turn sync functions async
Downloads
2
Readme
Asyncify (asfy)
Introduction:
Turn a sync function async
Example:
var sum = function(a, b) {
return a + b;
};
var result = sum(5, 5); // 10
turns into
var asfy = require('asfy');
var sum = function(a, b) {
return a + b;
};
var asyncSum = asfy(sum);
asyncSum(5, 5, function(err, result) {
console.log(result); // 10
})