@fand/async-node
v0.2.2
Published
Run node.js scripts wrapped with async function
Downloads
38
Readme
async-node
You can write await
s on top level!
Install
npm i -g @fand/async-node
Usage
async-node
runs Node.js scripts wrapping them with async
function.
$ cat foo.js
const res = await Promise.resolve('RESOLVED!');
console.log(res);
$ async-node foo.js
RESOLVED!
wrap-with-async
will output transformed script to stdout.
$ wrap-with-async foo.js > bar.js
$ cat bar.js
(async function () { const res = await Promise.resolve('RESOLVED!');
console.log(res);
})().catch(e => {})
LICENSE
MIT