Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.16 KB

readme.md

File metadata and controls

37 lines (25 loc) · 1.16 KB

node-signals

Register callback on node process signals.

github package npm package github ci codecov coverage

Table of contents

Presentation

@jsenv/node-signals was designed to cleanup things (gracefully if possible), when node process exits.

Installation

npm install @jsenv/[email protected]
import { teardownSignal } from "@jsenv/node-signals"

teardownSignal.addCallback((reason) => {
  console.log(`teardown because ${reason}`)
})

For node < 13

const { teardownSignal } = require("@jsenv/node-signals")