Adds listeners for exit events for inquirer prompts
Adds listeners for exit events. Most commonly needed for inquirer prompts.
Listens for ctrl + c
and escape
to add necessary new lines in output for next prompt.
$ npm install JakeJohnson05/InquirerExitListener
require this package before creating any inquiries and before possible long load times
require('inquirer-exit-listener');
// Now listening for close events
or call the exit function programmatically
const exitFunction = require('inquirer-exit-listener');
// Still listening for close events
// Call exitFunction() to programmatically end process
exitFunction();
// (beta) Include exit status code
exitFunction(1);
If you’re on Windows, do yourself a favor and use Windows Terminal instead of cmd.exe
.