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

pidtree

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pidtree

Cross platform children list of a PID

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12M
increased by1.94%
Maintainers
1
Weekly downloads
 
Created

What is pidtree?

The pidtree npm package is a Node.js module that allows you to list all running processes in a hierarchical tree structure based on their process IDs (PIDs). It can be used to find parent and child processes of a given PID, which is useful for monitoring and managing system processes programmatically.

What are pidtree's main functionalities?

Get an array of all running processes as a tree

This code sample demonstrates how to retrieve a tree of all running processes. The '-1' argument specifies that the tree should start with the root process. The callback function receives the tree structure or an error.

const pidtree = require('pidtree');
pidtree(-1, function (err, tree) {
  if (err) throw err;
  console.log(tree);
});

Get a tree of child processes for a specific PID

This code sample shows how to get a tree of child processes for a specific PID. Replace '1234' with the PID of the process you want to inspect. The callback function will receive the tree of child processes or an error.

const pidtree = require('pidtree');
const pid = 1234; // Replace with the target PID
pidtree(pid, function (err, tree) {
  if (err) throw err;
  console.log(tree);
});

Other packages similar to pidtree

Keywords

FAQs

Package last updated on 13 Apr 2020

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