![Medium](https://img.shields.io/badge/%E2%80%8B-medium-4cc61e.svg?logo=medium)
Human-friendly process signals.
This is a map of known process signals with some information about each signal.
Unlike
os.constants.signals
this includes:
- human-friendly description, default action and priority
- signals not supported by the current OS, which means you can safely use this
on any platform
Example
const { signalsByName, signalsByNumber } = require('human-signal')
console.log(signalsByName.SIGTERM)
// {
// name: 'SIGINT',
// number: 2,
// description: 'User interruption with CTRL-C',
// action: 'terminate',
// priority: false,
// source: 'ansi'
// }
console.log(signalsByNumber[8])
// {
// name: 'SIGFPE',
// number: 8,
// action: 'core',
// description: 'Floating point arithmetic error',
// priority: false,
// source: 'ansi'
// }
Install
npm install human-signal
Usage
signalsByName
Type: object
Object whose keys are signal names and values are
signal objects.
signalsByNumber
Type: object
Object whose keys are signal numbers and values are
signal objects.
signal
Type: object
signal.name
Type: string
Standard name of the signal, for example 'SIGINT'
.
signal.number
Type: number
Code number of the signal, for example 2
. While most number
are
cross-platform, some are different between different OS.
signal.description
Type: string
Human-friendly description for the signal, for example
'User interruption with CTRL-C'
.
signal.action
Type: string
Enum: 'terminate'
, 'core'
, 'ignore'
, 'pause'
,
'unpause'
What is the default action for this signal when it is not handled.
signal.priority
Type: boolean
Whether the signal's default action cannot be prevented. This is true
for
SIGTERM
, SIGKILL
and SIGSTOP
.
signal.source
Type: string
Enum: 'ansi'
, 'posix'
, 'bsd'
, 'systemv'
, 'other'
Which standards defined that signal.
Support
If you found a bug or would like a new feature, don't hesitate to
submit an issue on GitHub.
For other questions, feel free to
chat with us on Gitter.
Everyone is welcome regardless of personal background. We enforce a
Code of conduct in order to promote a positive and
inclusive environment.
Contributing
This project was made with ❤️. The simplest way to give back is by starring and
sharing it online.
If the documentation is unclear or has a typo, please click on the page's Edit
button (pencil icon) and suggest a correction.
If you would like to help us fix a bug or add a new feature, please check our
guidelines. Pull requests are welcome!