top level main function to wrap an async function


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
Minified + 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.