https://github.com/jakejohnson05/inquirerexitlistener
Adds listeners for exit events for inquirer prompts
https://github.com/jakejohnson05/inquirerexitlistener
bash-prompt cmd javascript js
Last synced: 26 days ago
JSON representation
Adds listeners for exit events for inquirer prompts
- Host: GitHub
- URL: https://github.com/jakejohnson05/inquirerexitlistener
- Owner: JakeJohnson05
- Created: 2020-03-26T23:06:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T03:28:01.000Z (over 3 years ago)
- Last Synced: 2025-08-21T03:55:28.915Z (10 months ago)
- Topics: bash-prompt, cmd, javascript, js
- Language: TypeScript
- Size: 546 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# InquirerExitListener
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.
## Install
```console
$ npm install JakeJohnson05/InquirerExitListener
```
## Usage
require this package before creating any inquiries and before possible long load times
```js
require('inquirer-exit-listener');
// Now listening for close events
```
or call the exit function programmatically
```js
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);
```
## Windows
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.