Skip to content

Run Node.js scripts wrapped with async function

Notifications You must be signed in to change notification settings

fand/async-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Run Node.js scripts wrapped with async function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published