Human-friendly process signals ported to deno.
This is a map of known process signals with some information about each signal.
Unlike
os.constants.signals
this includes:
- human-friendly descriptions
- default actions, including whether they can be prevented
- whether the signal is supported by the current OS
Example
import { signalsByName } from "https://deno.land/x/human_signals/mod.ts";
console.log(signalsByName.SIGINT);
// {
// name: 'SIGINT',
// number: 2,
// description: 'User interruption with CTRL-C',
// supported: true,
// action: 'terminate',
// forced: false,
// standard: 'ansi'
// }Usage
signalsByName
Type: object
Object whose keys are signal names and values are signal objects.
signal
Type: object
Signal object with the following properties.
name
Type: string
Standard name of the signal, for example 'SIGINT'.
number
Type: number
Code number of the signal, for example 2. While most number are
cross-platform, some are different between different OS.
description
Type: string
Human-friendly description for the signal, for example
'User interruption with CTRL-C'.
supported
Type: boolean
Whether the current OS can handle this signal in Node.js using
process.on(name, handler).
The list of supported signals is OS-specific.
action
Type: string
Enum: 'terminate', 'core', 'ignore', 'pause', 'unpause'
What is the default action for this signal when it is not handled.
forced
Type: boolean
Whether the signal’s default action cannot be prevented. This is true for
SIGTERM, SIGKILL and SIGSTOP.
standard
Type: string
Enum: 'ansi', 'posix', 'bsd', 'systemv', 'other'
Which standard defined that signal.