1.1.0 • Published 6 years ago

@wealthbar/mainjs v1.1.0

Weekly downloads
2
License
MIT
Repository
gitlab
Last release
6 years ago

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.