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

macos-menubar-watch

v0.1.6

Published

Run a shell command and show its output in the macOS menu bar.

Downloads

175

Readme

macos-menubar-watch

Run a shell command on an interval and show its latest output in the macOS menu bar.

This package is designed to ship a precompiled macOS binary, so end users do not need swift installed.

If the command output contains numeric values such as 350, 350M, or 12.5%, the dropdown menu also renders a recent trend chart. The output supports | grouping for dual-axis plotting: values on the left side of | are plotted on the left Y axis, and values on the right side are plotted on the right Y axis. Without |, if exactly two numeric values are extracted it is interpreted as A | B; if more than two numeric values are extracted, all of them are plotted on the left Y axis.

Numeric history is persisted under ~/.macos-menubar-watch/ as plain text:

  • grouped samples: unix_timestamp left_values | right_values
  • examples: unix_timestamp 111.000000 222.000000 | 333.000000, unix_timestamp | 111.000000 222.000000
  • older history files in the previous format are still readable

Long gaps such as app restarts are visually compressed in the chart and marked with dashed gap indicators instead of wasting horizontal space.

Features

  • precompiled macOS binary distribution, so users do not need swift installed
  • text-only menu bar summary, with extracted numeric values
  • multi-series dual-axis charting with | grouping
  • persisted numeric history under ~/.macos-menubar-watch/
  • scroll-to-zoom and scroll-to-pan chart navigation
  • temporary click annotations for screenshots
  • Copy Chart Image menu action to place the current chart snapshot on the clipboard

Usage

npx macos-menubar-watch "date '+%H:%M:%S'"
npx macos-menubar-watch --interval 2 "pmset -g batt | head -1"
npx macos-menubar-watch -n 10 "curl -s https://api.coinbase.com/v2/prices/BTC-USD/spot | sed -E 's/.*\"amount\":\"([0-9.]+)\".*/BTC\/\\1/'"
p=$(pgrep -f 'ZoomCefHelper \(Renderer\)' | tail -1); npx macos-menubar-watch --history-key zoom-cef-renderer-mem-cpu -n 2 "[ $p ] && printf '%s %s\n' \"\$(top -l 1 -pid $p -stats mem 2>/dev/null | sed -n '\$p' | xargs)\" \"\$(ps -p $p -o %cpu= | xargs)\" || echo N/A"

Command Output Rules

  • no numeric values: only the latest text is shown
  • A B C | X Y: left axis gets A B C, right axis gets X Y
  • A B |: all values are on the left axis
  • | X Y: all values are on the right axis
  • no | and exactly two numeric values: interpreted as A | B
  • no | and more than two numeric values: all extracted numeric values are plotted on the left axis

Use --history-key when the command string contains unstable values such as PIDs and you want a stable history filename.

Development

npm run build
node ./bin/macos-menubar-watch.js --help

Notes

  • macOS only
  • Published package should not require swift on the end-user machine
  • Maintainers need Xcode or Xcode Command Line Tools to run npm run build
  • Recent numeric samples are cached in memory for several hours and restored from ~/.macos-menubar-watch/ on launch
  • Click the menu bar item and choose Exit to stop it