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
console.logs "done" before exiting the process when the promise resolves.
f throws the exception is sent to