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

@prostoteam/prostometrics-node

v0.2.2

Published

Lightweight, non-blocking Node.js client for emitting Prostometrics metrics.

Readme

Prostometrics Node Client

Node.js client for sending application metrics to Prostometrics.

Install

npm install @prostoteam/prostometrics-node

Quick Start

import { init, count, countUnique, total, value, valueSparse, label } from "@prostoteam/prostometrics-node";

const client = init("payments-api", {
  apiKey: "your-prostometrics-api-key",
});

count("requests", 1, "service=api", label("method", "GET"));
countUnique(42n, "daily_active_users", "service=api");
total("host.net.kb", 2048, "iface=eth0", "dir=rx");
value("latency_ms", 123.4, "service=api", "endpoint=/login");
valueSparse("host.fs.capacity_kb", 1024 * 1024, "mount=/");

await client.close();

API

const client = new Client(workload, config);
const client = init(workload, config);

client.count(metric, delta, ...labels);
client.countUnique(uniqueID, metric, ...labels);
client.total(metric, total, ...labels);
client.value(metric, value, ...labels);
client.valueSparse(metric, value, ...labels);
await client.close();

Package-level helpers (count, countUnique, total, value, valueSparse) use the client created by init.

uniqueID accepts non-negative safe integers, bigint, decimal strings, Buffer, or Uint8Array.

Configuration

type Config = {
  apiKey?: string;
  logger?: { printf?: (format: string, ...args: unknown[]) => void };
  verbose?: boolean;
  silent?: boolean;
};

Warnings that indicate metric loss or disabled ingestion are written to stderr by default. Routine recovery, retry, version, and flush diagnostics are logged only when verbose is enabled. Set silent to disable all SDK logs.

During temporary outages, the client buffers up to 30 minutes of metrics in memory and replays them gradually with their original timestamps. The buffer is bounded and is lost when the process exits.

apiKey is required unless you supply your own transport, and init throws MissingAPIKeyError when it is absent. Configuration errors are raised at construction on purpose — a missing key is a deployment mistake worth failing loudly at boot, not one to discover from a silent metric later. There is no environment-variable fallback here; read the key yourself if you want one.

A rejected API key disables ingestion for the rest of the process, with one exception: for the first 30 seconds after the client is created, a rejection is retried instead. A key created moments earlier takes a few seconds to become usable, so a process started right after the key was pasted in keeps its first metrics rather than going quiet.

Two things narrow that window rather than widening it. A client key — the _pk_ kind, which belongs in a browser and can never authenticate here — is refused immediately and named as such, because no amount of waiting will make it work. And a process that ends while a rejection is still unresolved says so during close(), naming the events it never delivered, so a short script written to check that a key works cannot exit quietly on the "retrying" line alone.

Use valueSparse for values whose last observation should carry across missing time buckets.