@wealthbar/mainjs

top level main function to wrap an async function

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@wealthbar/mainjs
Minified + gzip package size for @wealthbar/mainjs in KB

Readme

mainjs

Sets the unhandledRejection to log to console.error and provides a wrapper to emulate top-level await for scripts. main will exit after the promise returned from f resolves.

main(f:()=>Promise<any>):void

Runs f and console.logs "done" before exiting the process when the promise resolves. If f throws the exception is sent to console.error.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.