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

@cues/sawdust

v0.1.1

Published

Runtime-agnostic logging toolkit built on LogLayer — Node and browser console/consola/pretty transports, request-scoped context, and structured error serialization. Datadog logs/RUM/APM live in @cues/sawdust-datadog.

Readme

@cues/sawdust

Runtime-agnostic logging toolkit for shared browser, Node.js, and worker runtimes with singleton-driven orchestration and pluggable transports, built on LogLayer.

📖 Documentation: https://catesandrew.github.io/sawdust/ — getting started, guides, architecture with sequence diagrams, and the full pattern catalog. Source lives in website/.

Features

  • Unified logging API shared across Node.js, browsers, and background workers.
  • Singleton-backed façade that upgrades in place while preserving façade imports.
  • Rich metadata branding for logger instances (stage, priority, transports, trace).
  • Optional Datadog transports for server and browser, with trace injection support.
  • Context propagation utilities (AsyncLocalStorage on Node, stack emulation on web).
  • Composable transport factories (console, pretty terminal, Consola, Datadog).
  • Runtime metadata collectors for service ownership, release, and environment data.
  • Developer-friendly debugging helpers (pretty printing, structured console output).
  • Structured error serialization with round-trippable custom error constructors.

Install

pnpm add @cues/sawdust

The Datadog browser SDKs (@datadog/browser-logs, @datadog/browser-rum) are optional peer dependencies — install them only if you enable the browser Datadog transports or RUM.

Usage

import { logger, configureLogger } from '@cues/sawdust/logger'

configureLogger({
  prefix: '[Server]',
  transports: {
    console: { enabled: true },
    datadog: {
      enabled: true,
      options: { service: 'my-service', source: 'node' },
    },
  },
})

logger.info('Sawdust is ready', { env: process.env.NODE_ENV })
import {
  logger,
  configureLogger,
  adoptExternalLogger,
  type LoggerOptions,
} from '@cues/sawdust/logger'

const options: LoggerOptions = {
  prefix: '[UI]',
  transports: {
    console: { enabled: true },
    pretty: { enabled: import.meta.env.MODE === 'development' },
    datadogBrowser: {
      enabled: true,
      options: { forwardErrorsToLogs: true },
    },
  },
}

const browserLogger = configureLogger(options, { stage: 'final', id: 'web:final' })

// Later, adopt an externally created logger (e.g. one provided by the framework runtime)
adoptExternalLogger(browserLogger.child({ viewport: 'desktop' }), { id: 'web:extern' })

browserLogger.info('Hydration complete')

Entry points

The package exposes runtime-conditional exports. Import a bare module name and the correct browser/node variant is resolved automatically:

  • @cues/sawdust — public types and shared helpers (formatError, rum, logger utilities).
  • @cues/sawdust/logger — the logger façade and configureLogger / adoptExternalLogger.
  • @cues/sawdust/types and @cues/sawdust/types/* — public type definitions.
  • @cues/sawdust/serializeError — structured error serialization helpers.

Configuration

  • Environment variables
    • NODE_ENV — toggles pretty transport defaults.
    • DD_API_KEY, DD_CLIENT_TOKEN — enable Datadog server/browser transports.
    • DD_TRACE_ENABLED — controls Datadog trace injection in Node.
  • Logger hints (configureLogger / adoptExternalLogger)
    • stage: 'preinit' | 'partial' | 'final' (affects scoring).
    • id: human-friendly identifier recorded in logger metadata.
    • force: override scoring rules for explicit replacements.
  • Transports
    • transports.console.enabled — force-enable native console logging.
    • transports.pretty.viewMode — 'inline' | 'expanded' output style.
    • transports.datadog.options — Datadog transport configuration (API host, tags).
    • datadogTraceInjection.enabled — enable dd-trace correlation (Node only).

Development

pnpm install      # install dependencies
pnpm typecheck    # type-check without emitting
pnpm build        # emit ESM bundles + declarations to dist/
pnpm lint         # run Biome
pnpm test         # run the Vitest suite

Build artifacts populate dist/ with ESM output and type declarations. Submit changes with a green typecheck, lint, and test.