{"_id":"tinyps","_rev":"3-4741daa611e065ab09d8d7f16f259b51","name":"tinyps","dist-tags":{"latest":"0.5.1"},"versions":{"0.2.0":{"name":"tinyps","version":"0.2.0","keywords":["proc","process","tree-kill","ps-tree","tiny","kill","tree"],"author":{"url":"https://github.com/43081j","name":"James Garbutt"},"license":"MIT","_id":"tinyps@0.2.0","maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"homepage":"https://github.com/tinylibs/tinyps#readme","bugs":{"url":"https://github.com/tinylibs/tinyps/issues"},"dist":{"shasum":"c0c937d2d2c2bee349a06bb01bce06e06612e4b1","tarball":"https://registry.npmjs.org/tinyps/-/tinyps-0.2.0.tgz","fileCount":5,"integrity":"sha512-3aX+X4lNK8O5wcy8z/J8znhtqecjQa69aCV/bHihGhVNs//HFBMs1M9Vrzn0moivLCp6cHg8tlrDvVUP5zuIfA==","signatures":[{"sig":"MEUCIBspt3wLtlpwadAfiaGFYI4j0iodlJzUk6X1p+IjakRlAiEAuVMzcLDuma37mYMUD9gsNhgUCvUNY8trgqw+8+x+j1M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13216},"main":"./lib/main.js","type":"module","types":"./lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","default":"./lib/main.js"}},"gitHead":"3b59f89d7a1ea9761df941cfebd2c0b0ccdd6656","scripts":{"lint":"npm run lint:js && npm run lint:format","test":"vitest run","build":"npm run build:clean && tsgo","format":"oxfmt --write src","lint:js":"oxlint src","build:clean":"node -e \"require('fs').rmSync('./lib', { recursive: true, force: true })\"","lint:format":"oxfmt --check src"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"repository":{"url":"git+https://github.com/tinylibs/tinyps.git","type":"git"},"_npmVersion":"12.0.1","description":"A library of utilities for dealing with system processes.","directories":{},"_nodeVersion":"26.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.67.0","oxlint":"^1.63.0","vitest":"^5.0.0","@types/node":"^26.5.1","@vitest/coverage-v8":"^5.0.0","@typescript/native-preview":"^7.0.0-dev.20260509.2"},"_npmOperationalInternal":{"tmp":"tmp/tinyps_0.2.0_1790166195944_0.0015074493490081498","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"tinyps","version":"0.5.0","keywords":["proc","process","tree-kill","ps-tree","tiny","kill","tree"],"author":{"url":"https://github.com/43081j","name":"James Garbutt"},"license":"MIT","_id":"tinyps@0.5.0","maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"homepage":"https://github.com/tinylibs/tinyps#readme","bugs":{"url":"https://github.com/tinylibs/tinyps/issues"},"dist":{"shasum":"0ea9362ac63bc85a36c2c3c536b17162a2b28c7c","tarball":"https://registry.npmjs.org/tinyps/-/tinyps-0.5.0.tgz","fileCount":7,"integrity":"sha512-Llu7nEtVOGHh7jok32l6+udlu+4Np5vsYVB7zeTK614coSsro2qjwte7MFt/ouLM/h4kXqbGXktSMMvMsttSDw==","signatures":[{"sig":"MEQCIAMOx8KrROn8dNsdghp0wE1W9ece3C34Nu1tsWFYF/38AiA8bJn26WJV2pm4L0pXnCBCgqJXe3qTUwvgBsUGnHimoA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tinyps@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15196},"main":"./lib/main.js","type":"module","types":"./lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","default":"./lib/main.js"}},"gitHead":"5b67717a9f646983c19f4147ea8bcb736739147d","scripts":{"lint":"npm run lint:js && npm run lint:format","test":"vitest run","build":"npm run build:clean && tsgo","format":"oxfmt --write src","lint:js":"oxlint src","build:clean":"node -e \"require('fs').rmSync('./lib', { recursive: true, force: true })\"","lint:format":"oxfmt --check src"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","approver":{"name":"43081j","email":"43081james@gmail.com"},"trustedPublisher":{"id":"github","oidcConfigId":"oidc:0788222f-e220-4505-8bc1-c16750b7f929"}},"repository":{"url":"git+https://github.com/tinylibs/tinyps.git","type":"git"},"_npmVersion":"12.1.0","description":"A library of utilities for dealing with system processes.","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.67.0","oxlint":"^1.63.0","vitest":"^5.0.0","@types/node":"^26.5.1","@vitest/coverage-v8":"^5.0.0","@typescript/native-preview":"^7.0.0-dev.20260509.2"},"_npmOperationalInternal":{"tmp":"tmp/tinyps_0.5.0_1790185130480_0.7384209695113702","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"_id":"tinyps@0.5.1","bugs":{"url":"https://github.com/tinylibs/tinyps/issues"},"dist":{"shasum":"2a1e313067badcdf8d5cb86f734514178e57147f","tarball":"https://registry.npmjs.org/tinyps/-/tinyps-0.5.1.tgz","integrity":"sha512-B6Ykif5HflC3AdDkS4Zst/2muYVfeXoVMy+KorqH80s/1x4vunIORpNySH681X7fjj+dFM9MDKD6/Hsccjb87Q==","fileCount":7,"unpackedSize":16559,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tinyps@0.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE5OXTIar8AjNkwu+Xm4RWJu5fIn8tVHb0s4eEjoVvFSAiARj8lO7VnXQYOqR07TQEF0Gnmq3diczGMYfL2U5NamxQ=="}]},"main":"./lib/main.js","name":"tinyps","type":"module","types":"./lib/main.d.ts","author":{"url":"https://github.com/43081j","name":"James Garbutt"},"exports":{".":{"types":"./lib/main.d.ts","default":"./lib/main.js"}},"gitHead":"432a7b0d11ece4fee3caef36c24b03edff31b19b","license":"MIT","scripts":{"lint":"npm run lint:js && npm run lint:format","test":"vitest run","build":"npm run build:clean && tsgo","format":"oxfmt --write src","lint:js":"oxlint src","build:clean":"node -e \"require('fs').rmSync('./lib', { recursive: true, force: true })\"","lint:format":"oxfmt --check src"},"version":"0.5.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"0788222f-e220-4505-8bc1-c16750b7f929"},"approver":{"name":"43081j","email":"43081james@gmail.com"}},"homepage":"https://github.com/tinylibs/tinyps#readme","keywords":["proc","process","tree-kill","ps-tree","tiny","kill","tree"],"repository":{"url":"git+https://github.com/tinylibs/tinyps.git","type":"git"},"_npmVersion":"12.2.0","description":"A library of utilities for dealing with system processes.","directories":{},"maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"_nodeVersion":"24.22.0","publishConfig":{"access":"public"},"devDependencies":{"oxfmt":"^0.71.0","oxlint":"^1.86.0","vitest":"^5.0.0","@types/node":"^26.6.3","@vitest/coverage-v8":"^5.0.2","@typescript/native-preview":"^7.0.0-dev.20260509.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tinyps_0.5.1_1792571533511_0.6190369791888344"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-23T12:23:15.622Z","modified":"2026-10-21T08:32:13.945Z","0.2.0":"2026-09-23T12:23:16.084Z","0.5.0":"2026-09-23T17:38:50.607Z","0.5.1":"2026-10-21T08:32:13.611Z"},"bugs":{"url":"https://github.com/tinylibs/tinyps/issues"},"author":{"url":"https://github.com/43081j","name":"James Garbutt"},"license":"MIT","homepage":"https://github.com/tinylibs/tinyps#readme","keywords":["proc","process","tree-kill","ps-tree","tiny","kill","tree"],"repository":{"url":"git+https://github.com/tinylibs/tinyps.git","type":"git"},"description":"A library of utilities for dealing with system processes.","maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"readme":"# ⚙️ tinyps\n\nA cross-platform library of utilities for dealing with system processes.\n\n## Install\n\n```sh\nnpm install tinyps\n```\n\n## Usage\n\n```ts\nimport { killTree, getProcessTree, getProcessAncestry } from 'tinyps';\n\n// kill a process and everything it spawned\nawait killTree(child.pid);\n\n// or inspect the tree first\nconst tree = await getProcessTree(child.pid);\nconsole.log(tree.get(child.pid)); // [ 1234, 1235 ]\n\n// trace a process's parent chain back to the root\nconst ancestry = await getProcessAncestry(child.pid);\nconsole.log(ancestry.map((proc) => proc.pid)); // [ childPid, parentPid, ... ]\n```\n\n## API\n\n### `killTree(pid, signal?)`\n\n- `pid` (`number`) - process to kill, along with all of its descendants\n- `signal` (`NodeJS.Signals`, optional) - signal to send, defaults to `SIGTERM`\n- Returns `Promise<void>`\n\nNote that `signal` is not supported on Windows, and will be ignored.\n\n### `getProcessTree(pid)`\n\n- `pid` (`number`) - process to build the tree from\n- Returns `Promise<ProcessTree>`\n\n### `isRunning(pid)`\n\n- `pid` (`number`) - process to check\n- Returns `boolean`\n\nA zombie process is still in the process table, so this returns `true` for a\nprocess which has exited but has not yet been released by its parent.\n\n### `getDescendants(pid)`\n\n- `pid` (`number`) - process to collect descendants of\n- Returns `Promise<number[]>`\n\n### `getProcessAncestry(pid?)`\n\n- `pid` (`number`, optional) - process to trace ancestry from, defaults to `process.pid`\n- Returns `Promise<ProcessInfo[]>`\n\nReturns an ordered list of process info objects starting from the target process and traversing upward through its parents to the root process.\n\n**Note:** On Windows, a parent may have exited and had its pid reassigned. In that case, the ancestry may contain unrelated processes.\n\n### `listProcesses()`\n\n- Returns `Promise<ProcessInfo[]>`\n\n### `getProcessInfo(pid)`\n\n- `pid` (`number`) - process to look up\n- Returns `Promise<ProcessInfo | undefined>`\n\n### `findProcessesByName(name, options?)`\n\n- `name` (`string`) - name to match against\n- `options.loose` (`boolean`, optional) - match any name containing `name`, ignoring case\n- Returns `Promise<ProcessInfo[]>`\n\nNames come from the process' `argv[0]`, so a process which has renamed itself\n(e.g. via `process.title`) matches its new name rather than its executable.\n\n### `findProcessesByPort(port, options?)`\n\n- `port` (`number`) - local port to match against\n- `options.protocol` (`'tcp' | 'udp'`, optional) - only match sockets of this\n  protocol, defaults to matching both\n- Returns `Promise<ProcessInfo[]>`\n\nMatches any process holding a socket bound to `port` locally, whether it is\nlistening or connected.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}