esc-exit

    3.0.0 • Public • Published

    esc-exit

    Exit the process when the esc key is pressed

    Useful for CLI tools to let the user press esc or control+c to get out.

    Install

    $ npm install esc-exit
    

    Usage

    import escExit from 'esc-exit';
    
    escExit();

    API

    Using this prevents the process from exiting normally.

    There are multiple ways you can handle this:

    • Call the unsubscribe method that escExit() returns when you're done listening. It will then let the process exit normally.

    • Call process.exit() to exit the process directly.

    Install

    npm i esc-exit

    DownloadsWeekly Downloads

    4,606

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    2.99 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar