How to use terminate - 3 common examples

To help you get started, we’ve selected a few terminate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jcoreio / crater / util / launchAndWait.js View on Github external
const kill = () => {
      if (!exited) terminate(child.pid)
    }
    process.on('exit', kill)
github strues / boldr / packages / boldr-dx / src / plugins / webpackPlugin / index.js View on Github external
async end() {
      if (serverCompiler) {
        terminate(process.pid);
      }
      return true;
    },
  };
github jcoreio / crater / scripts / util / kill.js View on Github external
child.removeListener('exit', resolve)
      child.removeListener('error', reject)
    }
    function resolve() {
      unlisten()
      _resolve()
    }
    function reject(error: Error) {
      unlisten()
      _reject(error)
    }
    child.on('exit', resolve)
    child.on('error', reject)
    if (timeout) setTimeout((): any => reject(new Error('kill timed out')), timeout)
    if (signal) child.kill(signal)
    else terminate(child.pid)
  })
}

terminate

Terminate a Node.js Process based on the Process ID

GPL-2.0
Latest version published 4 months ago

Package Health Score

74 / 100
Full package analysis

Popular terminate functions