Cross Exit
Gracefully terminate a script in Node.js or browsers. Works as a drop-in replacement for process.exit
.
Install
npm install cross-exit
Strategy
In Node.js, cross-exit
uses process.exit()
and in browsers, window.onerror
is temporarily set to hide a termination error which is then thrown.
Usage
const exit = ; console;;console;
API
crossExit(code?)
code
Type: number
Default: 0
The exit code.