npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@webpod/ps

v1.2.1

Published

A process lookup utility

Readme

@webpod/ps

A Node.js module for looking up running processes. Originated from neekey/ps, UmbraEngineering/ps and completely reforged.

Features

  • Written in TypeScript, ships with types
  • CJS and ESM entry points
  • Promise and callback API, sync variants
  • Process tree traversal by parent pid
  • Uses @webpod/ingrid instead of table-parser (neekey/ps#76, neekey/ps#62)

Install

npm install @webpod/ps

Internals

| Platform | Command | |---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------| | Unix / macOS | ps -eo pid,ppid,args | | Windows (kernel >= 26000) | pwsh -NoProfile -Command "Get-CimInstance Win32_Process \| Select-Object ProcessId,ParentProcessId,CommandLine \| ConvertTo-Json -Compress" | | Windows (kernel < 26000) | wmic process get ProcessId,CommandLine |

API

lookup(query?, callback?)

Returns a list of processes matching the query.

import { lookup } from '@webpod/ps'

// Find by pid
const list = await lookup({ pid: 12345 })
// [{ pid: '12345', ppid: '123', command: '/usr/bin/node', arguments: ['server.js', '--port=3000'] }]

// Filter by command and/or arguments (treated as RegExp)
const nodes = await lookup({ command: 'node', arguments: '--debug' })

// Filter by parent pid
const children = await lookup({ ppid: 82292 })

// Synchronous
const all = lookup.sync()

On Unix, you can override the default ps arguments via psargs:

const list = await lookup({ command: 'node', psargs: '-eo pid,ppid,comm' })

Callback style is also supported:

lookup({ pid: 12345 }, (err, list) => { /* ... */ })

tree(opts?, callback?)

Returns child processes of a given parent pid.

import { tree } from '@webpod/ps'

// Direct children
const children = await tree(123)
// [
//   { pid: '124', ppid: '123', command: 'node', arguments: ['worker.js'] },
//   { pid: '125', ppid: '123', command: 'node', arguments: ['worker.js'] }
// ]

// All descendants
const all = await tree({ pid: 123, recursive: true })
// [
//   { pid: '124', ppid: '123', ... },
//   { pid: '125', ppid: '123', ... },
//   { pid: '126', ppid: '124', ... },
//   { pid: '127', ppid: '125', ... }
// ]

// Synchronous
const list = tree.sync({ pid: 123, recursive: true })

kill(pid, opts?, callback?)

Kills a process and waits for it to exit. The returned promise resolves once the process is confirmed dead, or rejects on timeout.

import { kill } from '@webpod/ps'

// Sends SIGTERM, polls until the process is gone (default timeout 30s)
await kill(12345)

// With signal
await kill(12345, 'SIGKILL')

// With custom timeout (seconds) and polling interval (ms)
await kill(12345, { signal: 'SIGKILL', timeout: 10, interval: 250 })

// With callback
await kill(12345, (err, pid) => {
  // called when the process is confirmed dead or timeout is reached
})

License

MIT