asf
v0.1.2
Published
transform any function to AsyncFunction!
Downloads
66
Maintainers
Readme
Introduction
Simple AsyncFunction builder for ES6.
How To Use
####install
$ npm install asf
####hello world
var asf = require('asf');
function * es5yield(arg1,arg2){
var data1 = yield arg1;
var data2 = yield * loadAsync(arg2);
return {
data1:data1,
data2:data2
}
}
async function es6(arg1,arg2){
var data1 = await arg1;
var data2 = await loadAsync(arg2);
return {
data1:data1,
data2:data2
}
}
// asf(es5yield) == es6