human-signals
Advanced tools
Comparing version 2.1.0 to 3.0.0
@@ -1,4 +0,4 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SIGNALS=void 0; | ||
const SIGNALS=[ | ||
export const SIGNALS=[ | ||
{ | ||
@@ -272,3 +272,3 @@ name:"SIGHUP", | ||
description:"Invalid system call", | ||
standard:"other"}];exports.SIGNALS=SIGNALS; | ||
standard:"other"}]; | ||
//# sourceMappingURL=core.js.map |
@@ -1,5 +0,5 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.signalsByNumber=exports.signalsByName=void 0;var _os=require("os"); | ||
import{constants}from"os"; | ||
var _signals=require("./signals.js"); | ||
var _realtime=require("./realtime.js"); | ||
import{SIGRTMAX}from"./realtime.js"; | ||
import{getSignals}from"./signals.js"; | ||
@@ -9,3 +9,3 @@ | ||
const getSignalsByName=function(){ | ||
const signals=(0,_signals.getSignals)(); | ||
const signals=getSignals(); | ||
return signals.reduce(getSignalByName,{}); | ||
@@ -24,3 +24,3 @@ }; | ||
const signalsByName=getSignalsByName();exports.signalsByName=signalsByName; | ||
export const signalsByName=getSignalsByName(); | ||
@@ -31,4 +31,4 @@ | ||
const getSignalsByNumber=function(){ | ||
const signals=(0,_signals.getSignals)(); | ||
const length=_realtime.SIGRTMAX+1; | ||
const signals=getSignals(); | ||
const length=SIGRTMAX+1; | ||
const signalsA=Array.from({length},(value,number)=> | ||
@@ -64,3 +64,3 @@ getSignalByNumber(number,signals)); | ||
const findSignalByNumber=function(number,signals){ | ||
const signal=signals.find(({name})=>_os.constants.signals[name]===number); | ||
const signal=signals.find(({name})=>constants.signals[name]===number); | ||
@@ -71,6 +71,6 @@ if(signal!==undefined){ | ||
return signals.find(signalA=>signalA.number===number); | ||
return signals.find((signalA)=>signalA.number===number); | ||
}; | ||
const signalsByNumber=getSignalsByNumber();exports.signalsByNumber=signalsByNumber; | ||
export const signalsByNumber=getSignalsByNumber(); | ||
//# sourceMappingURL=main.js.map |
@@ -1,6 +0,6 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SIGRTMAX=exports.getRealtimeSignals=void 0; | ||
const getRealtimeSignals=function(){ | ||
export const getRealtimeSignals=function(){ | ||
const length=SIGRTMAX-SIGRTMIN+1; | ||
return Array.from({length},getRealtimeSignal); | ||
};exports.getRealtimeSignals=getRealtimeSignals; | ||
}; | ||
@@ -18,3 +18,3 @@ const getRealtimeSignal=function(value,index){ | ||
const SIGRTMIN=34; | ||
const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX; | ||
export const SIGRTMAX=64; | ||
//# sourceMappingURL=realtime.js.map |
@@ -1,13 +0,13 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getSignals=void 0;var _os=require("os"); | ||
import{constants}from"os"; | ||
var _core=require("./core.js"); | ||
var _realtime=require("./realtime.js"); | ||
import{SIGNALS}from"./core.js"; | ||
import{getRealtimeSignals}from"./realtime.js"; | ||
const getSignals=function(){ | ||
const realtimeSignals=(0,_realtime.getRealtimeSignals)(); | ||
const signals=[..._core.SIGNALS,...realtimeSignals].map(normalizeSignal); | ||
export const getSignals=function(){ | ||
const realtimeSignals=getRealtimeSignals(); | ||
const signals=[...SIGNALS,...realtimeSignals].map(normalizeSignal); | ||
return signals; | ||
};exports.getSignals=getSignals; | ||
}; | ||
@@ -30,3 +30,3 @@ | ||
signals:{[name]:constantSignal}}= | ||
_os.constants; | ||
constants; | ||
const supported=constantSignal!==undefined; | ||
@@ -33,0 +33,0 @@ const number=supported?constantSignal:defaultNumber; |
{ | ||
"name": "human-signals", | ||
"version": "2.1.0", | ||
"main": "build/src/main.js", | ||
"version": "3.0.0", | ||
"type": "module", | ||
"exports": "./build/src/main.js", | ||
"files": [ | ||
"build/src", | ||
"!~" | ||
"build/src/**/*.{js,ts,map,json,sh,md}", | ||
"examples/**/*.{js,ts,map,json,sh,md}" | ||
], | ||
@@ -12,7 +13,2 @@ "scripts": { | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-push": "gulp check --full" | ||
} | ||
}, | ||
"description": "Human-friendly process signals", | ||
@@ -53,14 +49,10 @@ "keywords": [ | ||
"types": "build/src/main.d.ts", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@ehmicky/dev-tasks": "^0.31.9", | ||
"ajv": "^6.12.0", | ||
"ava": "^3.5.0", | ||
"gulp": "^4.0.2", | ||
"husky": "^4.2.3", | ||
"test-each": "^2.0.0" | ||
"@ehmicky/dev-tasks": "^1.0.33", | ||
"ajv": "^6.12.6", | ||
"test-each": "^3.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=10.17.0" | ||
"node": ">=12.20.0" | ||
} | ||
} |
[![Codecov](https://img.shields.io/codecov/c/github/ehmicky/human-signals.svg?label=tested&logo=codecov)](https://codecov.io/gh/ehmicky/human-signals) | ||
[![Travis](https://img.shields.io/badge/cross-platform-4cc61e.svg?logo=travis)](https://travis-ci.org/ehmicky/human-signals) | ||
[![Build](https://github.com/ehmicky/human-signals/workflows/Build/badge.svg)](https://github.com/ehmicky/human-signals/actions) | ||
[![Node](https://img.shields.io/node/v/human-signals.svg?logo=node.js)](https://www.npmjs.com/package/human-signals) | ||
[![Gitter](https://img.shields.io/gitter/room/ehmicky/human-signals.svg?logo=gitter)](https://gitter.im/ehmicky/human-signals) | ||
[![Twitter](https://img.shields.io/badge/%E2%80%8B-twitter-4cc61e.svg?logo=twitter)](https://twitter.com/intent/follow?screen_name=ehmicky) | ||
@@ -23,3 +22,3 @@ [![Medium](https://img.shields.io/badge/%E2%80%8B-medium-4cc61e.svg?logo=medium)](https://medium.com/@ehmicky) | ||
```js | ||
const { signalsByName, signalsByNumber } = require('human-signals') | ||
import { signalsByName, signalsByNumber } from 'human-signals' | ||
@@ -55,2 +54,6 @@ console.log(signalsByName.SIGINT) | ||
This package is an ES module and must be loaded using | ||
[an `import` or `import()` statement](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c), | ||
not `require()`. | ||
# Usage | ||
@@ -106,3 +109,3 @@ | ||
The list of supported signals | ||
[is OS-specific](https://github.com/ehmicky/cross-platform-node-guide/blob/master/docs/6_networking_ipc/signals.md#cross-platform-signals). | ||
[is OS-specific](https://github.com/ehmicky/cross-platform-node-guide/blob/main/docs/6_networking_ipc/signals.md#cross-platform-signals). | ||
@@ -132,8 +135,4 @@ ### action | ||
If you found a bug or would like a new feature, _don't hesitate_ to | ||
[submit an issue on GitHub](../../issues). | ||
For any question, _don't hesitate_ to [submit an issue on GitHub](../../issues). | ||
For other questions, feel free to | ||
[chat with us on Gitter](https://gitter.im/ehmicky/human-signals). | ||
Everyone is welcome regardless of personal background. We enforce a | ||
@@ -140,0 +139,0 @@ [Code of conduct](CODE_OF_CONDUCT.md) in order to promote a positive and |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3
Yes
43577
12
367
165