1.1.0 • Published 6 years ago
@wealthbar/mainjs v1.1.0
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.log
s "done" before exiting the process when the promise resolves.
If f
throws the exception is sent to console.error
.