awaitify v1.1.0
A lightweight library to simplify asynchronous operations using function generators and yield
keyword, which is an alternative for Async/Await
keywords without having to use any Transpiler like babel. You could wrap the function generator inside this function like this:
var awaitify = ; var getUsers = ; ; // or var users = ;console;
which allows you await on a promise using yield
keyword.
yield awaitify.map([], function* (){})
const mapList = { const mappedUsersInfoList = awaitify; // You can have access to the new list of usersInfo};
awaitify.parallel({})
const loadData = { const users config = awaitify; // You can have access to both users and config variable here};
promise.then(function*(){})
This library also allows the pass generator functions to the promise chain implemented by this module:
;
awaitify.cb
var awaitify = ;var fs = ;var awaitify); var main = ; ; // or
awaitify.module
const SampleModuleV1 = awaitify; const SampleModuleV2 = awaitify; const result = SampleModuleV2;console; // "Something V1, V2"