If the async function fails, set the process exit code to 1 and output the error to stderr.
npm install @sounisi5011/cli-utils-top-level-await
yarn add @sounisi5011/cli-utils-top-level-await
pnpm add @sounisi5011/cli-utils-top-level-await
const { awaitMainFn } = require('@sounisi5011/cli-utils-top-level-await');
awaitMainFn(async () => {
// ...
});