Catches a promise error, writes the stacktrace to stderr and exists
npm install apr-main
Catches a promise error, writes the stacktrace to stderr and exists
 
Parameters
- input Promise
Examples
``javascript
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