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

@nan0web/telemetry

v0.1.0

Published

Observability layer for nan0web ecosystem. Collects, aggregates, and reports metrics from @nan0web/db.

Downloads

57

Readme

@nan0web/telemetry

Observability layer for nan0web ecosystem. Collects, aggregates, and reports metrics from any @nan0web/db instance.

Features

  • Zero Runtime Dependencies: Uses DB's existing on()/emit() contract.
  • O(1) Collectors: Counter-based metrics with zero unbounded array growth.
  • Multi-DB Support: Aggregate metrics from multiple databases into a single report.
  • URI Filtering: Drill down into metrics by URI prefix (e.g., users/).
  • Performance Benchmarks: Built-in SET/GET benchmark runner with p50/p95/p99.
  • i18n CLI Sandbox: Interactive playground for exploring metrics.

Installation

How to install with npm?

npm install @nan0web/telemetry

How to install with pnpm?

pnpm add @nan0web/telemetry

How to install with yarn?

yarn add @nan0web/telemetry

Quick Start

Telemetry connects to any @nan0web/db instance and starts collecting metrics automatically.

How to connect to a database?

import { Telemetry } from '@nan0web/telemetry'
const t = new Telemetry()
const db = { on: () => {} }
t.connect(db)
console.info(String(t)) // -> [telemetry] uptime: 0s cache: 0 hits...

Reading Metrics

Call report() to get a snapshot of all collected metrics. Optionally pass a URI prefix to filter.

How to read metrics?

import { Telemetry } from '@nan0web/telemetry'
const t = new Telemetry()
const listeners = new Map()
const db = {
	on(event, fn) {
		listeners.set(event, fn)
	},
	emit(event, data) {
		if (listeners.has(event)) listeners.get(event)(data)
	},
}
t.connect(db)
db.emit('cache', { hit: true, uri: 'users/1.json' })
const report = t.report()
console.info(report.cache.hits) // -> 1

Reset

Reset all counters without disconnecting.

How to reset counters?

import { Telemetry } from '@nan0web/telemetry'
const t = new Telemetry()
t.reset()
console.info('Reset successful')

Streams

Use toStream() to get a ReadableStream that periodically emits reports.

How to stream metrics periodically?

import { Telemetry } from '@nan0web/telemetry'
const t = new Telemetry()
const stream = t.toStream({ interval: 10 })
const reader = stream.getReader()
const { value: report } = await reader.read()
console.info(typeof report) // -> object
await reader.cancel()

Benchmarks

Run performance benchmarks on any database.

How to run performance benchmarks?

import { bench } from '@nan0web/telemetry'
const db = { on: () => {}, saveDocument: async () => {} }
const stats = await bench(db, 'saveDocument', { samples: 10, data: { status: 'ok' } })
console.info(stats.mean > 0) // -> true

Human-Readable Output

Use toString() for a quick console summary.

How to get human-readable summary?

import { Telemetry } from '@nan0web/telemetry'
const t = new Telemetry()
const summary = t.toString()
console.info(summary.slice(0, 11)) // -> [telemetry]

Java•Script

Uses d.ts files for autocompletion

Contributing

How to contribute? - check here

License

How to license? - ISC LICENSE file.

const text = fsNode.readFileSync('LICENSE', 'utf8')