Server : LiteSpeed
System : Linux r30.merodns.com 5.14.0-687.31.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Aug 1 05:38:01 EDT 2026 x86_64
User : iylf ( 1056)
PHP Version : 8.2.33
Disable Function : mail
Directory :  /proc/thread-self/root/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/

📁 Create New:
⬆️ Upload File:
Current Dir [ Not Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

📄 File: signal-manager.js

Path: //proc/thread-self/root/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/signal-manager.js

Size: 820 B

Permissions: 0644

const runningProcs = new Set()
let handlersInstalled = false

const forwardedSignals = [
  'SIGINT',
  'SIGTERM',
]

const handleSignal = signal => {
  for (const proc of runningProcs) {
    proc.kill(signal)
  }
}

const setupListeners = () => {
  for (const signal of forwardedSignals) {
    process.on(signal, handleSignal)
  }
  handlersInstalled = true
}

const cleanupListeners = () => {
  if (runningProcs.size === 0) {
    for (const signal of forwardedSignals) {
      process.removeListener(signal, handleSignal)
    }
    handlersInstalled = false
  }
}

const add = proc => {
  runningProcs.add(proc)
  if (!handlersInstalled) {
    setupListeners()
  }

  proc.once('exit', () => {
    runningProcs.delete(proc)
    cleanupListeners()
  })
}

module.exports = {
  add,
  handleSignal,
  forwardedSignals,
}

← Back to Directory Edit File 🔒 Chmod

WP File Manager