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

@spectosh/node

v0.2.0

Published

Backend spans for Specto session replay — continues the browser's trace on your Node server and exports it over OTLP/HTTP. No dependencies.

Readme

@spectosh/node

Backend spans for Specto session replay — no dependencies. With the browser SDK's traces: true, each request your app makes carries a W3C traceparent header; this tracer continues that trace on your Node server and sends its spans to Specto over OTLP/HTTP. In the replay, the request shows what the server did: timings, child spans, the exception.

Already on OpenTelemetry? Point its OTLP HTTP/JSON exporter at Specto instead (see the backend traces guide).

npm install @spectosh/node
import { createTracer } from '@spectosh/node'

const tracer = createTracer({
  endpoint: 'https://your-specto-host/api/otlp/v1/traces',
  serverKey: process.env.SPECTO_SERVER_KEY, // Settings → Install → Backend traces
  service: 'api',
})

// Express, Connect or node:http
app.use(tracer.middleware())
// … your routes …
app.use(tracer.errorHandler())

// fetch-style handlers (Next.js route handlers, Remix, Hono, TanStack Start…)
export const POST = tracer.wrap(async (request) => Response.json(await checkout(request)))

// child spans
const user = await tracer.span('SELECT users', () => db.query(sql), { 'db.system': 'postgresql' })
  • One SERVER span per request, named METHOD /path (Express: the matched route), with http.request.method, url.path and http.response.status_code. Query strings are never recorded.
  • Errors thrown inside span() / wrap() (or passed to tracer.captureException(err)) become exception events and mark the span as an error; 5xx responses do too.
  • Spans are exported in batches every 2 s; a failed export is retried with the next batch (up to 5,000 spans kept). Call await tracer.flush() before a serverless function returns and await tracer.shutdown() on exit.
  • Calling another service: send tracer.current.traceparent as its traceparent header and its spans join the same trace.
  • Without an endpoint and key the tracer does nothing — safe in development. Options can also come from SPECTO_OTLP_ENDPOINT, SPECTO_SERVER_KEY and SPECTO_SERVICE.

The server key is a secret: keep it in your server's environment, never in browser code. Specto stores only its hash, redacts attributes named like secrets and masks emails, tokens and card-like numbers on arrival.

MIT licensed.