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

optops

v0.2.1

Published

Analyze a Kubernetes cluster and estimate what it could cost

Readme

optops

Analyze a Kubernetes cluster and estimate what it could cost.

npx optops@latest analyze

No account, no operator, no signup. It reads your current kube-context, computes locally, and prints four panels: what you run, how much of it you use, what is blocking consolidation, and what the same workload would cost.


Example

╭─ Cluster Snapshot ─────────────────────────────╮
│  Nodes            4                            │
│  CPU capacity     7.7 cores                    │
│  Memory capacity  32 GiB                       │
│  Provider         GCP                          │
│  Capacity mix     100% spot                    │
╰────────────────────────────────────────────────╯

╭─ Utilization ──────────────────────────────────╮
│  CPU                                           │
│  █░░░░░░░░░░░░░░░░░░░  10% used                │
│  0.7 cores used of 7.7 · 6.0 requested (77%)   │
╰────────────────────────────────────────────────╯

╭─ Estimated optops Savings ─────────────────────╮
│  Current spend    $87/mo                       │
│                                                │
│  Rightsizing      $44/mo −49%                  │
│                   requests 15x usage on CPU    │
│                                                │
│  On-demand mix    $163/mo                      │
│                   $76/mo more — already spot   │
│                                                │
│  All-spot (max)   $54/mo −38%                  │
╰────────────────────────────────────────────────╯

Usage

optops analyze                     # current kube-context
optops analyze --context staging   # a specific context
optops analyze -o json | jq        # machine-readable, same figures
optops analyze -o plain            # no colour or box drawing, for CI
optops version

analyze-cluster still works as an alias for analyze.

What it needs

Read access to the cluster. It never writes:

- apiGroups: [""]               resources: [nodes, pods]           verbs: [get, list]
- apiGroups: ["policy"]         resources: [poddisruptionbudgets]  verbs: [get, list]
- apiGroups: ["metrics.k8s.io"] resources: [nodes, pods]           verbs: [get, list]

metrics-server is optional. Without it the Utilization panel is blank and the rightsizing row is omitted — the remaining scenarios work from pod requests.

How the estimate works

Four scenarios, priced against a catalog baked into the binary at build time:

| Scenario | Meaning | |---|---| | Rightsizing | Requests sized to observed usage at a 70% ceiling, then repacked | | On-demand mix | Cheapest on-demand fleet for the same workload | | Spot-friendly | Interruption-tolerant workloads on spot, the rest on-demand | | All-spot | Everything on spot — an upper bound, not a target |

Deliberate properties worth knowing:

  • Only rightsizing reads usage. The other three re-pack today's requests unchanged, so on a cluster requesting far more than it uses, rightsizing is usually the largest number by some margin.
  • Rightsizing is scaled by 0.85. A single snapshot cannot see burst headroom or seasonal peaks, so the figure is discounted. Both numbers are in the JSON.
  • Architecture is respected. An x86 cluster is never offered ARM instances its images cannot start on.
  • DaemonSets are a per-node tax, carried on every proposed node rather than treated as movable demand.
  • Savings are capped at 60% by platform convention; the raw figure is in the JSON as uncappedSavingsPercent.
  • Nothing is modelled that isn't stated. Pod affinity, topology spread, PodDisruptionBudgets and resource limits are not simulated, and the output says so.

Proposed instance types are in -o json under proposedNodes, so every figure can be recomputed by hand.

Figures are estimates from public list prices, not a quote.

Install

npx optops@latest analyze            # no install
npm install -g optops                # or install it
go install github.com/optops-ai/optops-cli/cmd/optops@latest   # or from source

Prebuilt binaries: macOS (arm64, x64), Linux (arm64, x64), Windows (x64).

Licence

Apache-2.0