This package is ESM only: Node 12+ is needed to use it and it must be import
ed
instead of require
d.
npm:
npm install bail
import {bail} from 'bail'
bail()
bail(new Error('failure'))
// Error: failure
// at repl:1:6
// at REPLServer.defaultEval (repl.js:154:27)
// …
This package exports the following identifiers: bail
.
There is no default export.
Throw a given error.
err
(Error?
) — Optional error.
Error
— Given error, if any.