{"_id":"@magda/tree-kill","name":"@magda/tree-kill","dist-tags":{"latest":"1.2.3"},"versions":{"1.2.3":{"name":"@magda/tree-kill","version":"1.2.3","description":"kill trees of processes","main":"index.js","types":"index.d.ts","bin":{"tree-kill":"cli.js"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/magda-io/node-tree-kill.git"},"homepage":"https://github.com/magda-io/node-tree-kill","keywords":["tree","trees","process","processes","kill","signal"],"author":{"name":"Peteris Krumins","email":"peteris.krumins@gmail.com","url":"http://www.catonmat.net"},"contributors":[{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},{"name":"William Hilton","email":"wmhilton@gmail.com","url":"http://wmhilton.com/"},{"name":"Fabrício Matté","url":"http://ultcombo.js.org/"}],"license":"MIT","devDependencies":{"mocha":"^2.2.5"},"_id":"@magda/tree-kill@1.2.3","gitHead":"34a14d315939566035be249a0772f0e1921d911e","bugs":{"url":"https://github.com/magda-io/node-tree-kill/issues"},"_nodeVersion":"18.20.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-QZ9pAuU1yDWx8z4dVAtR4w5wVMb++hmBCYi9Rj864TobnuG29gqVHmRuwcPAvFL8qjMfn5Z0Mcu4eCI5dmD1Sg==","shasum":"a4e5329d759da0985a8818e6b808aa4ccafe1c97","tarball":"https://registry.npmjs.org/@magda/tree-kill/-/tree-kill-1.2.3.tgz","fileCount":6,"unpackedSize":9110,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGFDpYqjh+YO5hxeM5v6+NP9igsZ7rqYVyE/txtpfAn7AiBSqabgjWvIIun5ic20WtHofjQr5EPaiTKUfzl8WVL9aw=="}]},"_npmUser":{"name":"t83714","email":"t83714@gmail.com"},"directories":{},"maintainers":[{"name":"kring","email":"kevin-npm@kotachrome.com"},{"name":"t83714","email":"t83714@gmail.com"},{"name":"magda.io","email":"contact@magda.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tree-kill_1.2.3_1754394424481_0.5691291702661543"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-05T11:47:04.380Z","1.2.3":"2025-08-05T11:47:04.660Z","modified":"2025-08-05T11:47:04.931Z"},"maintainers":[{"name":"kring","email":"kevin-npm@kotachrome.com"},{"name":"t83714","email":"t83714@gmail.com"},{"name":"magda.io","email":"contact@magda.io"}],"description":"kill trees of processes","homepage":"https://github.com/magda-io/node-tree-kill","keywords":["tree","trees","process","processes","kill","signal"],"repository":{"type":"git","url":"git://github.com/magda-io/node-tree-kill.git"},"contributors":[{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},{"name":"William Hilton","email":"wmhilton@gmail.com","url":"http://wmhilton.com/"},{"name":"Fabrício Matté","url":"http://ultcombo.js.org/"}],"author":{"name":"Peteris Krumins","email":"peteris.krumins@gmail.com","url":"http://www.catonmat.net"},"bugs":{"url":"https://github.com/magda-io/node-tree-kill/issues"},"license":"MIT","readme":"Tree Kill\n=========\n\nKill all processes in the process tree, including the root process.\n\n> This is a forked version of [tree-kill](https://www.npmjs.com/package/tree-kill). Included [Build process tree for macOS](https://github.com/pkrumins/node-tree-kill/pull/44)\n\nExamples\n=======\n\nKill all the descendent processes of the process with pid `1`, including the process with pid `1` itself:\n```js\nvar kill = require('tree-kill');\nkill(1);\n```\n\nSend a signal other than SIGTERM.:\n```js\nvar kill = require('tree-kill');\nkill(1, 'SIGKILL');\n```\n\nRun a callback when done killing the processes. Passes an error argument if there was an error.\n```js\nvar kill = require('tree-kill');\nkill(1, 'SIGKILL', function(err) {\n    // Do things\n});\n```\n\nYou can also install tree-kill globally and use it as a command:\n```sh\ntree-kill 1          # sends SIGTERM to process 1 and its descendents\ntree-kill 1 SIGTERM  # same\ntree-kill 1 SIGKILL  # sends KILL instead of TERMINATE\n```\n\nMethods\n=======\n\n## require('tree-kill')(pid, [signal], [callback]);\n\nSends signal `signal` to all children processes of the process with pid `pid`, including `pid`. Signal defaults to `SIGTERM`.\n\nFor Linux, this uses `ps -o pid --no-headers --ppid PID` to find the parent pids of `PID`.\n\nFor Darwin/OSX, this uses `pgrep -P PID` to find the parent pids of `PID`.\n\nFor Windows, this uses `'taskkill /pid PID /T /F'` to kill the process tree. Note that on Windows, sending the different kinds of POSIX signals is not possible.\n\nInstall\n=======\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install tree-kill\n```\n\nLicense\n=======\n\nMIT\n\nChangelog\n=========\n\n\n## [1.2.2] - 2019-12-11\n### Changed\n- security fix: sanitize `pid` parameter to fix arbitrary code execution vulnerability\n\n## [1.2.1] - 2018-11-05\n### Changed\n- added missing LICENSE file\n- updated TypeScript definitions\n\n## [1.2.0] - 2017-09-19\n### Added\n- TypeScript definitions\n### Changed\n- `kill(pid, callback)` works. Before you had to use `kill(pid, signal, callback)`\n\n## [1.1.0] - 2016-05-13\n### Added\n- A `tree-kill` CLI\n\n## [1.0.0] - 2015-09-17\n### Added\n- optional callback\n- Darwin support\n","readmeFilename":"README.md","_rev":"1-1406dccac8e18c9161e01e7c57f58b82"}