{"name":"pidtree","version":"0.5.0","description":"Cross platform children list of a PID","license":"MIT","homepage":"http://github.com/simonepri/pidtree#readme","repository":{"type":"git","url":"git+https://github.com/simonepri/pidtree.git"},"bugs":{"url":"https://github.com/simonepri/pidtree/issues","email":"simonepri@outlook.com"},"author":{"name":"Simone Primarosa","email":"simonepri@outlook.com","url":"https://github.com/simonepri"},"contributors":[{"name":"Simone Primarosa","email":"simonepri@outlook.com","url":"https://github.com/simonepri"}],"keywords":["ps-tree","ps","tree","ppid","pid","pidtree","pgrep","list","all","system","process","processes"],"main":"index.js","types":"index.d.ts","bin":{"pidtree":"bin/pidtree.js"},"engines":{"node":">=0.10"},"scripts":{"start":"node ./bin/pidtree.js","update":"npm-check -u","release":"np","lint":"xo","test":"nyc ava -m \"!*benchmark*\"","types":"tsd","bench":"ava -m \"*benchmark*\"","coverage":"codecov"},"devDependencies":{"ava":"~0.25.0","codecov":"^3.6.5","mockery":"^2.1.0","np":"^2.20.1","npm-check":"^5.9.2","nyc":"^11.6.0","pify":"^3.0.0","string-to-stream":"^1.1.0","through":"^2.3.8","time-span":"^2.0.0","tree-kill":"^1.1.0","tsd":"^0.11.0","xo":"~0.20.3"},"ava":{"verbose":true},"nyc":{"reporter":["lcovonly","text"]},"xo":{"prettier":true,"space":true,"rules":{"prefer-destructuring":0,"prefer-arrow-callback":0,"no-var":0,"object-shorthand":0,"unicorn/no-for-loop":0,"unicorn/prefer-string-slice":0,"unicorn/string-content":0}},"gitHead":"42ccacb446d8376fe666d24ed81f686069d6ecff","_id":"pidtree@0.5.0","_nodeVersion":"13.11.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9nxspIM7OpZuhBxPg73Zvyq7j1QMPMPsGKTqRc2XOaFQauDvoNz9fM1Wdkjmeo7l9GXOZiRs97sPkuayl39wjA==","shasum":"ad5fbc1de78b8a5f99d6fbdd4f6e4eee21d1aca1","tarball":"http://registry-npm.ywwl.com/pidtree/download/pidtree-0.5.0.tgz","fileCount":11,"unpackedSize":21998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelLnVCRA9TVsSAnZWagAAbHYP/i1ipmw8ybrSJR/ZOsMs\nPOC/sJU7E5yoQrfNR33KCCL1NWSrgnkAwBU7je+o/Y1B7A6XkHl6FmgBKOJ8\nn4xsal7hmVZM0detrfILm2GY58OzyRqgjMIAvydVoqq/hyjRrx8HSfRKXcEl\nuXxgi1aKIEYVWbf2dEG9NDzQmt+JGVzQWsmuWzUaS7F1appabcI1tDrt7/IC\n47SOoa/e8+MAodHcYxmSMq6FxxnYY0oz1pT4H6j7flOV2KD7YCo5abLeSaSU\nGDkYag3soN0wDLRQoHqNgHykiAHothhp5YdpzJxe/S4BRZepRD6SipBlWI+F\nUoqlw38EctqvCfzaZr8CDSAOrP7QGWfs4XYgKVFJO14RXpR97QeijJXRWi71\nmb74O/PyohMZxwqrAQEIaF9uolVGOPD4/y4+02ihA9SYOvh9rgzWgsymn7Zj\nGDxIl8vb6g81rGv476WAEHrMjMvsEnv6/246csqXS4AeEiwp9kMp4z4dekJR\n1rin7czwhTowyTrO8NdARCSu+ss9sETLENPi/ajSFH5Vji50fLvwikZtC0CY\nsA/LuHS6W3PNZwJ8fqJJzm0AAAQGZl7UFVbc9Nfi96WquVuKHztZzpI4YjX6\noLVjghoqvbFMzCvUb1Qd0h7VZkyp6u/k6GqcSM3AkAoX6yRZK3uS/LJ+97Z+\nZmwF\r\n=WhMX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYO/B/1J8dvurN1vf7sHWVNmL4dVoR1o7XJPHdl8OQMQIgK8EceVLxfadYf3T0Y+e48LPgMuyi1m5leOmyncUpGqs="}],"size":7015,"noattachment":false,"key":"/pidtree/-/pidtree-0.5.0.tgz"},"maintainers":[{"name":"simonepri","email":"simonepri@outlook.com"}],"_npmUser":{"name":"simonepri","email":"simonepri@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pidtree_0.5.0_1586805204709_0.14694612808741137"},"_hasShrinkwrap":false,"readme":"<h1 align=\"center\">\n  <b>pidtree</b>\n</h1>\n<p align=\"center\">\n  <!-- Version - npm -->\n  <a href=\"https://www.npmjs.com/package/pidtree\">\n    <img src=\"https://img.shields.io/npm/v/pidtree.svg\" alt=\"Latest version on npm\" />\n  </a>\n  <!-- Downloads - npm -->\n  <a href=\"https://npm-stat.com/charts.html?package=pidtree\">\n    <img src=\"https://img.shields.io/npm/dt/pidtree.svg\" alt=\"Downloads on npm\" />\n  </a>\n  <!-- License - MIT -->\n  <a href=\"https://github.com/simonepri/pidtree/tree/master/license\">\n    <img src=\"https://img.shields.io/github/license/simonepri/pidtree.svg\" alt=\"Project license\" />\n  </a>\n\n  <br/>\n\n  <!-- Lint -->\n  <a href=\"https://github.com/simonepri/pidtree/actions?query=workflow:lint+branch:master\">\n    <img src=\"https://github.com/simonepri/pidtree/workflows/lint/badge.svg?branch=master\" alt=\"Lint status\" />\n  </a>\n  <!-- Test - macOS -->\n  <a href=\"https://github.com/simonepri/pidtree/actions?query=workflow:test-macos+branch:master\">\n    <img src=\"https://github.com/simonepri/pidtree/workflows/test-macos/badge.svg?branch=master\" alt=\"Test macOS status\" />\n  </a>\n  <!-- Test - Ubuntu -->\n  <a href=\"https://github.com/simonepri/pidtree/actions?query=workflow:test-ubuntu+branch:master\">\n    <img src=\"https://github.com/simonepri/pidtree/workflows/test-ubuntu/badge.svg?branch=master\" alt=\"Test Ubuntu status\" />\n  </a>\n  <!-- Test - Windows -->\n  <a href=\"https://github.com/simonepri/pidtree/actions?query=workflow:test-windows+branch:master\">\n    <img src=\"https://github.com/simonepri/pidtree/workflows/test-windows/badge.svg?branch=master\" alt=\"Test Windows status\" />\n  </a>\n  <!-- Coverage - Codecov -->\n  <a href=\"https://codecov.io/gh/simonepri/pidtree\">\n    <img src=\"https://img.shields.io/codecov/c/github/simonepri/pidtree/master.svg\" alt=\"Codecov Coverage report\" />\n  </a>\n  <!-- DM - Snyk -->\n  <a href=\"https://snyk.io/test/github/simonepri/pidtree?targetFile=package.json\">\n    <img src=\"https://snyk.io/test/github/simonepri/pidtree/badge.svg?targetFile=package.json\" alt=\"Known Vulnerabilities\" />\n  </a>\n\n  <br/>\n\n  <!-- Code Style - XO-Prettier -->\n  <a href=\"https://github.com/xojs/xo\">\n    <img src=\"https://img.shields.io/badge/code_style-XO+Prettier-5ed9c7.svg\" alt=\"XO Code Style used\" />\n  </a>\n  <!-- Test Runner - AVA -->\n  <a href=\"https://github.com/avajs/ava\">\n    <img src=\"https://img.shields.io/badge/test_runner-AVA-fb3170.svg\" alt=\"AVA Test Runner used\" />\n  </a>\n  <!-- Test Coverage - Istanbul -->\n  <a href=\"https://github.com/istanbuljs/nyc\">\n    <img src=\"https://img.shields.io/badge/test_coverage-NYC-fec606.svg\" alt=\"Istanbul Test Coverage used\" />\n  </a>\n  <!-- Init - ni -->\n  <a href=\"https://github.com/simonepri/ni\">\n    <img src=\"https://img.shields.io/badge/initialized_with-ni-e74c3c.svg\" alt=\"NI Scaffolding System used\" />\n  </a>\n  <!-- Release - np -->\n  <a href=\"https://github.com/sindresorhus/np\">\n    <img src=\"https://img.shields.io/badge/released_with-np-6c8784.svg\" alt=\"NP Release System used\" />\n  </a>\n</p>\n<p align=\"center\">\n  🚸 Cross platform children list of a PID.\n\n  <br/>\n\n  <sub>\n    Coded with ❤️ by <a href=\"#authors\">Simone Primarosa</a>.\n  </sub>\n</p>\n\n## Synopsis\n\nThis package is really similar to [ps-tree][gh:ps-tree] but is faster, safer and\nprovides sub-children results.  \nFurthermore ps-tree is [unmaintained][gh:ps-tree-um].\n\nUuh, and a fancy [CLI](#cli) is also available!\n\n## Usage\n\n```js\nvar pidtree = require('pidtree')\n\n// Get childs of current process\npidtree(process.pid, function (err, pids) {\n  console.log(pids)\n  // => []\n})\n\n// Include the given pid in the result array\npidtree(process.pid, {root: true}, function (err, pids) {\n  console.log(pids)\n  // => [727]\n})\n\n// Get all the processes of the System (-1 is a special value of this package)\npidtree(-1, function (err, pids) {\n  console.log(pids)\n  // => [530, 42, ..., 41241]\n})\n\n// Include PPID in the results\npidtree(1, {advanced: true}, function (err, pids) {\n  console.log(pids)\n  // => [{ppid: 1, pid: 530}, {ppid: 1, pid: 42}, ..., {ppid: 1, pid: 41241}]\n})\n\n// If no callback is given it returns a promise instead\nconst pids = await pidtree(1)\nconsole.log(pids)\n// => [141, 42, ..., 15242]\n```\n\n## Compatibility\n\n| Linux | FreeBSD | NetBSD | SunOS | macOS | Win | AIX |\n| --- | --- | --- | --- | --- | --- | --- |\n| ✅ | ❓ | ❓ | ❓ | ✅ | ✅ | ❓ |\n\n✅ = Working\n❓ = Not tested but should work\n\nPlease if your platform is not supported [file an issue][new issue].\n\n## CLI\n\n<img src=\"https://github.com/simonepri/pidtree/raw/master/media/cli.gif\" alt=\"pidtree cli\" width=\"300\" align=\"right\"/>\nShow a tree of the processes inside your system inside your terminal.\n\n```bash\nnpx pidtree $PPID\n```\nJust replace `$PPID` with one of the pids inside your system.\n\nOr don't pass anything if you want all the pids inside your system.\n\n```bash\nnpx pidtree\n```\n\nTo display the output as a list, similar to the one produced from `pgrep -P $PID`,\npass the `--list` flag.\n\n```bash\nnpx pidtree --list\n```\n\n## API\n\n<a name=\"pidtree\"></a>\n\n## pidtree(pid, [options], [callback]) ⇒ <code>[Promise.&lt;Array.&lt;Object&gt;&gt;]</code>\nGet the list of children pids of the given pid.\n\n**Kind**: global function  \n**Returns**: <code>Promise.&lt;Array.&lt;Object&gt;&gt;</code> - Only when the callback is not provided.  \n**Access**: public  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| pid | <code>Number</code> \\| <code>String</code> |  | A pid. If -1 will return all the pids. |\n| [options] | <code>Object</code> |  | Optional options object. |\n| [options.root] | <code>Boolean</code> | <code>false</code> | Include the provided pid in the list. Ignored if -1 is passed as pid. |\n| [callback] | <code>function</code> |  | Called when the list is ready. If not provided a promise is returned instead. |\n\n## Related\n\n- [pidusage][gh:pidusage] -\nCross-platform process cpu % and memory usage of a PID\n\n## Authors\n\n- **Simone Primarosa** - [simonepri][github:simonepri]\n\nSee also the list of [contributors][contributors] who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [license][license] file for details.\n\n<!-- Links -->\n[new issue]: https://github.com/simonepri/pidtree/issues/new\n[license]: https://github.com/simonepri/pidtree/tree/master/license\n[contributors]: https://github.com/simonepri/pidtree/contributors\n\n[github:simonepri]: https://github.com/simonepri\n\n[gh:pidusage]: https://github.com/soyuka/pidusage\n[gh:ps-tree]: https://github.com/indexzero/ps-tree\n[gh:ps-tree-um]: https://github.com/indexzero/ps-tree/issues/30\n","publish_time":1586805204942,"_cnpm_publish_time":1586805204942,"dist-tags":{"latest":"1.0.0"}}