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

@emeryld/lllogger

v0.1.1

Published

Typed logger fanout with optional caller metadata, redaction, and batching.

Readme

@emeryld/lllogs

Typed logger fanout with optional caller metadata, redaction, and batching.

Install

npm i @emeryld/lllogs

Usage

import { createDocsLogger } from '@emeryld/lllogs';

type Defs = {
  info: { msg: string };
  error: { msg: string; err?: unknown };
};

const log = createDocsLogger<Defs>({
  enabled: true,
  callerSkip: ['node_modules', '/dist/'],
  batching: { enabled: true, maxSize: 100, intervalMs: 200 },
  loggers: {
    info: {
      enabled: true,
      logger: (x) => console.log(x),
      withCaller: (x, caller) => ({ ...x, caller })
    },
    error: {
      enabled: true,
      logger: (x) => console.error(x)
    }
  }
});

log.info({ msg: 'hello' });
log.flush();
log.shutdown();

Sampling

Each logger can declare sampleRate as either a static number or a function (log) => number. The value is treated as a drop probability: 0 keeps every event, 1 drops them all, and intermediate values probabilistically drop that fraction before batching. Using the function lets you recompute the rate per log—for example to disable sampling in prod paths. Omitting sampleRate logs everything.

// drop most debug noise, but keep errors
{
  sampleRate: (log) => (log.level === 'debug' ? 0.9 : 0)
}

Notes on batching behavior

  • Buffers are per logger key (e.g., info and error batch independently).
  • Flush triggers:
    • buffer reaches maxSize
    • interval timer (intervalMs)
    • manual flush()
    • shutdown() stops the timer and flushes remaining logs
  • If a flush throws while emitting, items are re-queued (best-effort) and onFlushError is called.

If you want a single global batch across all keys (instead of per-key), say so and I’ll adjust the queue structure accordingly.