Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inDemoInstall

signal-exit

Package Overview
Dependencies
0
Maintainers
2
Versions
19
Issues
File Explorer

Advanced tools

signal-exit

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

    3.0.7latest
    Github

Version published
Maintainers
2
Weekly downloads
39,746,972
increased by8.53%

Weekly downloads

Readme

Source

signal-exit

Build Status Coverage NPM version Standard Version

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

  • reaching the end of execution.
  • explicitly having process.exit(code) called.
  • having process.kill(pid, sig) called.
  • receiving a fatal signal from outside the process

Use signal-exit.

var onExit = require('signal-exit') onExit(function (code, signal) { console.log('process exited!') })

API

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 process to exit. That is, there are no other listeners, and it is a fatal signal.

Options

  • alwaysLast: Run this handler after any other signal or exit handlers. This causes process.emit to be monkeypatched.

Keywords

FAQs

What is signal-exit?

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

Is signal-exit popular?

The npm package signal-exit receives a total of 37,710,342 weekly downloads. As such, signal-exit popularity was classified as popular.

Is signal-exit well maintained?

We found that signal-exit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 2 open source maintainers collaborating on the project.

Last updated on 03 Feb 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket[email protected]

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc