Skip to content

jsenv/jsenv-node-signals

Repository files navigation

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")

About

Add callback to node process signals.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published