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

@onelog-sdk/node

v0.1.3

Published

OneLog Node SDK for unified tracing, logging, and error handling.

Readme

@onelog/node

Unified Node.js SDK for tracing, logging, HTTP calls, and exception capture. Drop it into any Express-based service to get consistent telemetry with one import.

Install

npm install @onelog/node

Quickstart

import express from 'express';
import { sdkStartPromise, instrumentApp, createLogger, errorMiddleware, httpCall } from '@onelog/node';

const logger = createLogger();
const app = express();
const PORT = process.env.PORT || 8700;

app.use(express.json());
instrumentApp(app, logger, process.env.MAIN_MODULE);

app.get('/health', (_req, res) => res.json({ status: 'ok', module: process.env.MAIN_MODULE }));

app.post('/do', async (req, res, next) => {
  try {
    const reply = await httpCall(
      process.env.PEER_URL || 'http://localhost:3001/work',
      { method: 'POST', body: req.body },
      logger,
      { flow: 'demo' }
    );
    res.json({ ok: true, reply });
  } catch (err) { next(err); }
});

app.use(errorMiddleware(logger));

sdkStartPromise.finally(() => {
  app.listen(PORT, () => logger.info({ port: PORT }, 'Service started'));
});

What’s inside

  • Tracing (sdkStartPromise, instrumentApp) — boots OpenTelemetry Node SDK with HTTP/Express/undici auto-instrumentation and renames spans to [module] METHOD /path while adding module.name.
  • Logging (createLogger) — Pino with dual transports: OTLP-friendly output plus pretty console, pre-tagged with env/app/module.
  • Exceptions (errorMiddleware) — records exceptions on the active span, sets span status to ERROR, logs details, and returns JSON.
  • HTTP calls (httpCall) — fetch wrapper with consistent logging, JSON handling, and error propagation.

Environment variables

  • PORT — HTTP port for your service.
  • MAIN_MODULE — logical module name (shown in spans and logs).
  • MAIN_APP — application/system name.
  • MAIN_ENV — environment (production/staging/dev).
  • OTEL_EXPORTER_OTLP_ENDPOINT — OTLP HTTP endpoint (e.g., http://localhost:4318, no trailing slash).
  • OTEL_SERVICE_NAME — service name for tracing.
  • OTEL_NAMESPACE / OTEL_SERVICE_NAMESPACE — optional namespace.
  • Downstream URLs as needed: PEER_URL, etc.
  • ONELOG_EXPRESS_LAYERS — set to true to include middleware/request_handler spans (defaults to lean mode without them).
  • HTTP_PROXY / HTTPS_PROXY (also lowercase variants) — if present, outbound HTTP (including OTLP export) uses the proxy.

Build (for contributors)

npm install
npm run build   # tsup → dist/index.{mjs,cjs} + types, minified

Notes

  • Requires Node 18+.
  • Auto-instrumentation is focused on HTTP/Express/undici; noisy instrumentations are off by default.