deasynchronize
Run asynchronous or synchronous function in subprocess and return result synchronously
Install
npm i -S deasynchronize
Usage
;console.logresult; // => 'async result 3'
API
deasynchronize...args: any, f:any: string
Function f
is not a closure and do not has access to parent scope, it runs in subprocess.
You should require all dependencies inside this function. Result will be converted to string.
;
It is possible to pass parameters to function:
;console.logresult; // => 'Incoming sound is meow'
Remember, this function is not a closure!