All Projects → simonepri → Pidtree

simonepri / Pidtree

Licence: mit
🚸 Cross platform children list of a PID.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Pidtree

Awesome Git Addons
😎 A curated list of add-ons that extend/enhance the git CLI.
Stars: ✭ 1,313 (+1627.63%)
Mutual labels:  cli, list
Cat Names
🐈 Get popular cat names
Stars: ✭ 226 (+197.37%)
Mutual labels:  cli, list
Tree Node Cli
🌲 Node.js library to list the contents of directories in a tree-like format, similar to the Linux tree command
Stars: ✭ 102 (+34.21%)
Mutual labels:  cli, tree
Gods
GoDS (Go Data Structures). Containers (Sets, Lists, Stacks, Maps, Trees), Sets (HashSet, TreeSet, LinkedHashSet), Lists (ArrayList, SinglyLinkedList, DoublyLinkedList), Stacks (LinkedListStack, ArrayStack), Maps (HashMap, TreeMap, HashBidiMap, TreeBidiMap, LinkedHashMap), Trees (RedBlackTree, AVLTree, BTree, BinaryHeap), Comparators, Iterators, …
Stars: ✭ 10,883 (+14219.74%)
Mutual labels:  tree, list
Project Explorer
🎋A CLI tool to create an annotated tree visualization of any project
Stars: ✭ 485 (+538.16%)
Mutual labels:  cli, tree
Containers
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
Stars: ✭ 125 (+64.47%)
Mutual labels:  tree, list
Typex
[TOOL, CLI] - Filter and examine Go type structures, interfaces and their transitive dependencies and relationships. Export structural types as TypeScript value object or bare type representations.
Stars: ✭ 128 (+68.42%)
Mutual labels:  cli, tree
Mal
MAL: A MyAnimeList Command Line Interface [BROKEN: BLAME MyAnimeList]
Stars: ✭ 104 (+36.84%)
Mutual labels:  cli, list
Awesome Shell
A curated list of awesome command-line frameworks, toolkits, guides and gizmos. Inspired by awesome-php.
Stars: ✭ 22,631 (+29677.63%)
Mutual labels:  cli, list
Datastructure
常用数据结构及其算法的Java实现,包括但不仅限于链表、栈,队列,树,堆,图等经典数据结构及其他经典基础算法(如排序等)...
Stars: ✭ 419 (+451.32%)
Mutual labels:  tree, list
Smart Array To Tree
Convert large amounts of data array to tree fastly
Stars: ✭ 91 (+19.74%)
Mutual labels:  tree, list
Structured Text Tools
A list of command line tools for manipulating structured text data
Stars: ✭ 6,180 (+8031.58%)
Mutual labels:  cli, list
Swordtooffer
经典常考必备面试算法,包括但不仅限于《剑指Offer》,《程序员面试金典》中的题目,持续更新中...
Stars: ✭ 81 (+6.58%)
Mutual labels:  tree, list
Computer Science In Javascript
Computer science reimplemented in JavaScript
Stars: ✭ 2,590 (+3307.89%)
Mutual labels:  tree, list
Mlib
Library of generic and type safe containers in pure C language (C99 or C11) for a wide collection of container (comparable to the C++ STL).
Stars: ✭ 321 (+322.37%)
Mutual labels:  tree, list
Learningmasteringalgorithms C
Mastering Algorithms with C 《算法精解:C语言描述》源码及Xcode工程、Linux工程
Stars: ✭ 615 (+709.21%)
Mutual labels:  tree, list
Nls
Missing inspector for npm packages.
Stars: ✭ 44 (-42.11%)
Mutual labels:  cli, list
Php codesniffer
PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
Stars: ✭ 9,004 (+11747.37%)
Mutual labels:  cli
Rdcli
The simple way to download and unrestrict DDL files, torrents and magnets
Stars: ✭ 75 (-1.32%)
Mutual labels:  cli
Radon
Various code metrics for Python code
Stars: ✭ 1,193 (+1469.74%)
Mutual labels:  cli

pidtree

Lint status Test macOS status Test Ubuntu status Test Windows status Codecov Coverage report Known Vulnerabilities Dependency Status
XO Code Style used AVA Test Runner used Istanbul Test Coverage used NI Scaffolding System used NP Release System used
Latest version on npm Project license

🚸 Cross platform children list of a PID.
Coded with ❤️ by Simone Primarosa.

Synopsis

This package is really similar to ps-tree but is faster, safer and provides sub-children results.
Furthermore ps-tree is unmaintained.

Uuh, and a fancy CLI is also available!

Usage

var pidtree = require('pidtree')

// Get childs of current process
pidtree(process.pid, function (err, pids) {
  console.log(pids)
  // => []
})

// Include the given pid in the result array
pidtree(process.pid, {root: true}, function (err, pids) {
  console.log(pids)
  // => [727]
})

// Get all the processes of the System (-1 is a special value of this package)
pidtree(-1, function (err, pids) {
  console.log(pids)
  // => [530, 42, ..., 41241]
})

// Include PPID in the results
pidtree(1, {advanced: true}, function (err, pids) {
  console.log(pids)
  // => [{ppid: 1, pid: 530}, {ppid: 1, pid: 42}, ..., {ppid: 1, pid: 41241}]
})

// If no callback is given it returns a promise instead
const pids = await pidtree(1)
console.log(pids)
// => [141, 42, ..., 15242]

Compatibility

Linux FreeBSD NetBSD SunOS macOS Win AIX

✅ = Working ❓ = Not tested but should work

Please if your platform is not supported file an issue.

CLI

pidtree cli Show a tree of the processes inside your system inside your terminal.
npx pidtree $PPID

Just replace $PPID with one of the pids inside your system.

Or don't pass anything if you want all the pids inside your system.

npx pidtree

To display the output as a list, similar to the one produced from pgrep -P $PID, pass the --list flag.

npx pidtree --list

API

pidtree(pid, [options], [callback]) ⇒ [Promise.<Array.<Object>>]

Get the list of children pids of the given pid.

Kind: global function
Returns: Promise.<Array.<Object>> - Only when the callback is not provided.
Access: public

Param Type Default Description
pid Number | String A pid. If -1 will return all the pids.
[options] Object Optional options object.
[options.root] Boolean false Include the provided pid in the list. Ignored if -1 is passed as pid.
[callback] function Called when the list is ready. If not provided a promise is returned instead.

Related

  • pidusage - Cross-platform process cpu % and memory usage of a PID

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the license file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].