How to use the signal-exit.signals function in signal-exit

To help you get started, we’ve selected a few signal-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 ehmicky / autoserver / src / run / exit / setup.js View on Github external
const getExitSignals = function() {
  const exitSignals = signals()
  return exitSignals.includes('SIGUSR2')
    ? exitSignals
    : [...exitSignals, 'SIGUSR2']
}
github tapjs / foreground-child / index.js View on Github external
function proxySignals (parent, child) {
  const listeners = new Map()

  for (const sig of signalExit.signals()) {
    const listener = () => child.kill(sig)
    listeners.set(sig, listener)
    parent.on(sig, listener)
  }

  return function unproxySignals () {
    for (const [sig, listener] of listeners) {
      parent.removeListener(sig, listener)
    }
  }
}

signal-exit

when you want to fire an event no matter how a process exits.

ISC
Latest version published 1 year ago

Package Health Score

77 / 100
Full package analysis

Popular signal-exit functions