项目作者: JakeJohnson05

项目描述 :
Adds listeners for exit events for inquirer prompts
高级语言: JavaScript
项目地址: git://github.com/JakeJohnson05/InquirerExitListener.git
创建时间: 2020-03-26T23:06:12Z
项目社区:https://github.com/JakeJohnson05/InquirerExitListener

开源协议:

下载


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

  1. $ npm install JakeJohnson05/InquirerExitListener

Usage

require this package before creating any inquiries and before possible long load times

  1. require('inquirer-exit-listener');
  2. // Now listening for close events

or call the exit function programmatically

  1. const exitFunction = require('inquirer-exit-listener');
  2. // Still listening for close events
  3. // Call exitFunction() to programmatically end process
  4. exitFunction();
  5. // (beta) Include exit status code
  6. exitFunction(1);

Windows

If you’re on Windows, do yourself a favor and use Windows Terminal instead of cmd.exe.