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

@uppercut-labs/electron-private-memory

v0.1.0

Published

Private memory of a running Electron app summed over its processes, by each system's definition (private bytes, phys_footprint, anonymous plus swap), with a budget and ceiling verdict.

Readme

@uppercut-labs/electron-private-memory

Measures the private memory of a running Electron app, summed over its processes, by the definition that fits each system, and compares it with a budget and a ceiling. These are the definitions Chromium uses for its own "private footprint":

| System | Definition | Scope | | --- | --- | --- | | Windows | private bytes | the processes Electron started (app.getAppMetrics()) | | macOS | phys_footprint, read with /usr/bin/footprint | the process tree under the root | | Linux | anonymous resident memory plus swap (Anonymous + Swap in /proc/<pid>/smaps_rollup) | the process tree under the root |

Electron is never imported. Reading processes and running programs go through options, so every path can run under test on any system.

npm install @uppercut-labs/electron-private-memory
import { app } from 'electron';
import { measureMemory } from '@uppercut-labs/electron-private-memory';

const report = await measureMemory({ getAppMetrics: () => app.getAppMetrics(), budgetMB: 300, ceilingMB: 680 });
console.log(`${report.privateMB} MB over ${report.processes} processes (${report.definition})`);
if (!report.underCeiling) process.exitCode = 1;

measureMemory(options)

| Option | Default | Meaning | | --- | --- | --- | | system | from process.platform | 'windows', 'macos' or 'linux' | | root | process.pid | the process whose tree is measured (macOS, Linux) | | getAppMetrics | none | Electron's app.getAppMetrics; required on Windows | | budgetMB, ceilingMB | 300, 680 | limits for withinBudget and underCeiling | | run(file, args) | execFile, 15 s limit | runs ps and footprint on macOS | | readFile(file), listProc() | fs | read /proc on Linux | | now() | new Date() | the clock for at |

The report: at, system, definition, scope, root, processes, privateMB (rounded to 0.1), budgetMB, ceilingMB, withinBudget, underCeiling, detail (one { pid, name, privateMB, residentMB?, unreadable? } per process) and error when the system's reading failed. On macOS the total is footprint's own summary; elsewhere it is the sum of detail.

On Windows, programs the app starts itself (a bundled tool) are not in Electron's list; measure them from outside. A Linux process that ends or cannot be read is listed with unreadable and 0 MB rather than dropped. Calling this from an Electron main process is cheap on Windows and Linux; on macOS it starts ps and footprint.

Helpers

| Function | Returns | | --- | --- | | descendants(root, pairs) | the root's id and every descendant's, from [pid, parent] pairs | | parsePs(text) | ps -axo pid=,ppid= output as pairs | | parseFootprint(text) | { detail, totalBytes } from footprint -f bytes --noCategories | | smapsValue(rollup, key) | one kB value from smaps_rollup, 0 when absent | | systemOf(platform?) | the system name for a Node platform |

License

MIT