Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tree-kill

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-kill

kill trees of processes

  • 1.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14M
increased by2.27%
Maintainers
2
Weekly downloads
 
Created

What is tree-kill?

The tree-kill npm package is used to kill all processes in the process tree, including the root process. It is particularly useful when you need to clean up all child processes spawned by a parent process, ensuring that no orphan processes remain running.

What are tree-kill's main functionalities?

Kill process trees on different platforms

This code kills the process tree with the PID 12345 on both Windows and Unix systems.

const treeKill = require('tree-kill');
treeKill(12345);

Kill process trees with a specific signal

This code sends the SIGKILL signal to the process tree with the PID 12345, forcing it to terminate immediately.

const treeKill = require('tree-kill');
treeKill(12345, 'SIGKILL');

Kill process trees with a callback

This code attempts to terminate the process tree with the PID 12345 using the SIGTERM signal and provides a callback to handle the result.

const treeKill = require('tree-kill');
treeKill(12345, 'SIGTERM', function(err) {
  if (err) {
    console.error('Error:', err);
  } else {
    console.log('Process tree terminated successfully.');
  }
});

Other packages similar to tree-kill

Keywords

FAQs

Package last updated on 11 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc