"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/signal-exit/README.md" (7 Feb 2017, 1497 Bytes) of archive /windows/misc/atom-windows.zip:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.


Build Status Coverage NPM version Windows Tests Standard Version

When you want to fire an event no matter how a process exits:

Use signal-exit.

var onExit = require('signal-exit')

onExit(function (code, signal) {
  console.log('process exited!')


var remove = onExit(function (code, signal) {}, options)

The return value of the function is a function that will remove the handler.

Note that the function only fires for signals if the signal would cause the proces to exit. That is, there are no other listeners, and it is a fatal signal.