Nullifying Precipitation Machine

    cross-exit
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    Cross Exit Travis CI Build Status

    Gracefully terminate a script in Node.js or browsers. Works as a drop-in replacement for process.exit.

    NPM Badge

    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 = require("cross-exit");
     
    console.log("This message is logged.");
    exit();
    console.log("This message isn't logged.");

    API

    crossExit(code?)

    code

    Type: number
    Default: 0

    The exit code.

    Install

    npm i cross-exit

    DownloadsWeekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.82 kB

    Total Files

    7

    Last publish

    Collaborators

    • richienb