human-signals
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Human-signals is an npm package that provides a map of known process signals with a plethora of useful information about each signal. This package brings human-friendly descriptions for the signals, details about their default actions, and highlights whether they can be prevented. An additional feature is its capability to show whether the signal is supported by the current operating system or not. This is an upgrade on the 'os.constants.signals' and works on Node.js version 16.17.0 or higher.
Using human-signals is very straightforward. Following is an example of how you can use this package:
//First, install the package:
npm install human-signals
//Include it in your code:
import { signalsByName, signalsByNumber } from 'human-signals';
console.log(signalsByName.SIGINT);
//This prints:
// {
// name: 'SIGINT',
// number: 2,
// description: 'User interruption with CTRL-C',
// supported: true,
// action: 'terminate',
// forced: false,
// standard: 'ansi'
// }
console.log(signalsByNumber[8]);
//This prints:
// {
// name: 'SIGFPE',
// number: 8,
// description: 'Floating point arithmetic error',
// supported: true,
// action: 'core',
// forced: false,
// standard: 'ansi'
// }
Please remember that this package is an ES module, and must be loaded using an import
or import()
statement, not require()
.
The documentation for human-signals is embedded within the package's Readme content available on the GitHub repository - https://github.com/ehmicky/human-signals. It offers diverse information about signal names and numbers, descriptions, supported or not status, default actions, whether they can be forced, and which standard defined that specific signal. You can also contribute or submit an issue via the provided GitHub link.