top level main function to wrap an async function


1.1.03 years ago3 years agoMinified + gzip package size for @wealthbar/mainjs in KB



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.


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.