How to use the capture-exit.offExit function in capture-exit

To help you get started, we’ve selected a few capture-exit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ember-cli / ember-cli / lib / utilities / will-interrupt-process.js View on Github external
removeHandler(cb) {
    let index = handlers.indexOf(cb);
    if (index < 0) {
      return;
    }

    handlers.splice(index, 1);
    captureExit.offExit(cb);

    if (handlers.length === 0) {
      teardownSignalsTrap();
    }
  },
};
github adopted-ember-addons / ember-electron / lib / models / assembler.js View on Github external
_cleanupSignals() {
    process.removeListener('SIGINT', this._boundOnSIGINT);
    process.removeListener('SIGTERM', this._boundOnSIGTERM);
    process.removeListener('message', this._boundOnMessage);
    exit.offExit(this._boundCleanup);

    if (/^win/.test(process.platform)) {
      this._cleanupWindowsSignals();
    }
  }

capture-exit

safely cleanup in signal handlers

ISC
Latest version published 6 years ago

Package Health Score

68 / 100
Full package analysis

Similar packages