Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

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

Version published
Maintainers
2
Weekly downloads
37,770,615
increased by0.01%

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 31,061,907 weekly downloads. As such, signal-exit popularity was classified as popular.

Is signal-exit well maintained?

We found that signal-exit demonstrated a healthy version release cadence and project activity. It has 2 open source maintainers collaborating on the project.

Last updated on 03 Feb 2022
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc