siginfo is a Node.js utility module designed to abstract and standardize the handling of process information signals across different operating systems. Specifically, it normalizes `SIGINFO` (used on BSD/macOS) and `SIGUSR1` (used on Linux), both conventionally triggered by `Ctrl+T` to request a running process to output its internal state or progress. The current stable version is 2.0.0. This package provides a simple API that allows developers to register a callback function which executes when one of these signals is received, typically logging process-specific metrics like version, uptime, or progress. It differentiates itself by providing a cross-platform wrapper for a specific, widely-understood signal convention, making it easier to build inspectable long-running Node.js processes without dealing with OS-specific signal handling directly. Release cadence is infrequent, reflecting its stable and focused functionality, primarily updating for Node.js compatibility or minor enhancements.
npm install siginfoVerified import paths — ran on the pinned version, not inferred.
Demonstrates setting up a `siginfo` listener to output process state (version, uptime, memory, custom metrics) when `Ctrl+T` (or the respective signal) is received.
If you need to receive signals in a non-TTY environment, pass `true` as the second argument: `siginfo(queryFn, true)`.
Rely on the module's abstraction; it handles platform differences. Avoid manually sending signals like `kill -USR1 <pid>` on macOS if you expect `Ctrl+T` to trigger `SIGINFO`.
Always store the return value of `siginfo()` and call `removeListener()` when the handler is no longer needed, especially in serverless or short-lived environments if the process might re-register handlers.
Ensure you are using the v2.0.0 API where `siginfo(fn)` returns `removeListener`. Review your code if upgrading from very old versions.
Use CommonJS `require` syntax: `const siginfo = require('siginfo')`.Ensure the process is run from an interactive terminal, or explicitly enable forcing the listener: `siginfo(myFunction, true)`.
No dependency data recorded yet.