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

@getmonitor/cli

v0.3.5

Published

Framework-agnostic source map upload tool for GetMonitor error tracking. Used directly, or via `@getmonitor/nextjs-config` / `@getmonitor/nuxt`, which call its programmatic API automatically as part of a customer's build.

Readme

@getmonitor/cli

Framework-agnostic source map upload tool for GetMonitor error tracking. Used directly, or via @getmonitor/nextjs-config / @getmonitor/nuxt, which call its programmatic API automatically as part of a customer's build.

What it does

For every *.js file with a resolvable source map under a directory, processSourceMaps:

  1. Generates a debug ID and injects it into both the JS file and its source map.
  2. Uploads the tagged source map to https://track.getmonitor.io/api/v1/sourcemaps — the upload host is fixed and not customer-configurable.
  3. On a successful upload: deletes the .map file and strips the //# sourceMappingURL= comment from the JS file, so nothing readable ships publicly.
  4. On a failed upload: leaves both files untouched, so the artifact can be retried.

A source map is resolved primarily via the JS file's //# sourceMappingURL= comment, falling back to same-basename-plus-.map when there's no comment, it's a data: URI, or the referenced file doesn't exist — this matters because bundlers don't always name maps predictably (content hashes, CDN rewrites).

See the Phase 2 design spec for the full architecture and upload contract.

CLI usage

npm install --save-dev @getmonitor/cli
getmonitor sourcemaps upload ./dist \
  --release 1.4.2 \
  --auth-token $GETMONITOR_AUTH_TOKEN

--release and --auth-token are optional if GETMONITOR_RELEASE / GETMONITOR_AUTH_TOKEN are set, or (for release) if the directory is inside a git working tree or has a reachable package.json with a version field. Release resolution precedence: --release flag > GETMONITOR_RELEASE env var > current git commit SHA > nearest package.json's version field.

The auth token is a secret credential, separate from the public gm_xxx key the SDKs use — never commit it or expose it client-side.

Programmatic usage

import { processSourceMaps } from '@getmonitor/cli'

const result = await processSourceMaps({
  directory: './dist',
  authToken: process.env.GETMONITOR_AUTH_TOKEN,
})

console.log(result.uploaded, result.failed)

This is what @getmonitor/nextjs-config and @getmonitor/nuxt call from their bundler's build-finished hook — see those packages for the build-tool-integrated version of this flow.

API reference

| Export | Signature | | --- | --- | | processSourceMaps(options) | (ProcessSourceMapsOptions) => Promise<ProcessSourceMapsResult> |

ProcessSourceMapsOptions = { directory: string; release?: string; authToken?: string; fetchImpl?: typeof fetch } (fetchImpl is a test/dependency-injection hook — most consumers won't need it). ProcessSourceMapsResult = { uploaded: string[]; failed: string[] } — full on-disk paths of each processed artifact, split by outcome.

Development

pnpm --filter @getmonitor/cli build     # rollup -> dist/ (library ESM+CJS+.d.ts, plus dist/bin.js)
pnpm --filter @getmonitor/cli test      # vitest run (excludes e2e/)
pnpm --filter @getmonitor/cli test:e2e  # vitest run e2e/processSourceMaps.spec.ts — real esbuild output + real HTTP server
pnpm --filter @getmonitor/cli lint      # tsc --noEmit (src/) + tsc --noEmit -p e2e

The e2e/ suite builds a real fixture through esbuild, runs processSourceMaps against the real output, and asserts against a real (in-process) mock ingestion server — no mocked fetch.