aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/siginfo/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'vanilla/node_modules/siginfo/index.js')
-rw-r--r--vanilla/node_modules/siginfo/index.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/vanilla/node_modules/siginfo/index.js b/vanilla/node_modules/siginfo/index.js
new file mode 100644
index 0000000..5092b61
--- /dev/null
+++ b/vanilla/node_modules/siginfo/index.js
@@ -0,0 +1,20 @@
+module.exports = function (query, force) {
+ var isAttached = false
+ if (process.stderr.isTTY || force === true) {
+ isAttached = true
+ process.on('SIGINFO', onsiginfo)
+ process.on('SIGUSR1', onsiginfo)
+ }
+
+ return function () {
+ if (isAttached === true) {
+ process.removeListener('SIGINFO', onsiginfo)
+ process.removeListener('SIGUSR1', onsiginfo)
+ isAttached = false
+ }
+ }
+
+ function onsiginfo () {
+ query()
+ }
+}