npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@eliware/signals

v15.0.1

Published

Graceful shutdown signal handler utility for Node.js

Readme

eliware.org

@eliware/signals npm License CI

Graceful shutdown signal handler utility for Node.js

Table of Contents

Features

The package starts cleanup for SIGTERM, SIGINT, and SIGHUP. Run ordered cleanup functions during shutdown. Set the exit code or prevent process exit.

Requirements

Use Node.js 26 or later. Use native ESM.

Setup

Run this command in your project:

npm install @eliware/signals

Usage

Import registerSignals from @eliware/signals. Pass a cleanup function as shutdownHook. Set exit: false when your application controls process exit. Call shutdown() to run cleanup and wait for all cleanup functions to complete. Call removeHandlers() when you no longer require the registration.

import registerSignals from "@eliware/signals";

registerSignals({
  shutdownHook: async () => {
    process.stdout.write("Cleanup complete\n");
  },
});

This example requires Node.js 26 or later and native ESM. Run it in a project that has this package installed. Send SIGTERM, SIGINT, or SIGHUP to run the cleanup function. The process exits with code 0 after the cleanup function completes.

Read the release notes for user-visible changes. Read the user guides for full usage details.

Development

Run npm ci to install the locked development dependencies. Read AGENTS.md for repository validation commands and the specification index for repository requirements.

Testing

Run npm test to validate the package.

Troubleshooting

Set exit: false when your application controls process exit. Call and await shutdown() when your application must wait for cleanup. Read the troubleshooting guide for more help.

Security

Keep secrets and sensitive shutdown data out of logs. Do not rely on asynchronous cleanup during Node.js exit events.

API

Call registerSignals(options?) to receive a registration object. Options include processObj, log, signals, shutdownHook, exitCode, exit, and signal. Each cleanup function runs in registration order. If a cleanup function fails, the package logs a fixed notice without error details and continues. Read the API reference and type declarations for details.

Packaging

Use numeric MAJOR.MINOR.PATCH versions and matching v<version> release tags. The npm workflow validates the matching tag and package version before publication. Run npm run pack to check package contents. Publish only after approved release steps.

Examples

Read the example index and run node examples/example.mjs.

Support

For help, questions, or to chat with the author and community, visit:

Discordeliware.org

eliware.org on Discord

Links

License

MIT © Eliware