@fand/async-node

0.2.2 • Public • Published

async-node

Build Status NPM Version License Coverage Status

You can write awaits on top level!

example

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

/@fand/async-node/

    Package Sidebar

    Install

    npm i @fand/async-node

    Weekly Downloads

    41

    Version

    0.2.2

    License

    MIT

    Last publish

    Collaborators

    • fand