Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

apr-main

ramitos212MIT4.0.3

Catches a promise error, writes the stacktrace to stderr and exists

main, run, first, async, await, promise, control, flow, control-flow, awaitful, promises, async-await, es2015, es2016, es2017, es6, es7, es8

readme

main

Catches a promise error, writes the stacktrace to stderr and exists

Parameters

Examples

import main from 'apr-main';

main(async () => 'hello') // writes nothing
main(async () => undefined) // writes nothing
main(async () => { throw new Error('uncaught error') }) // writes the stack trace to stderr and exists

Returns Promise