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

logan-logger

v2.5.2

Published

Universal TypeScript logging library for all JavaScript runtimes

Readme

Logan Logger

CI npm JSR

One logging API for Node.js, Deno, Bun and the browser. No dependencies.

import { createLogger, LogLevel } from 'logan-logger';

const logger = createLogger({ level: LogLevel.DEBUG });

logger.info('Application started');
logger.warn('Config missing', { file: 'config.json' });
logger.error('Query failed', { err: new Error('timeout') });

// Context that follows every record, without threading it through your code
const request = logger.child({ requestId: 'req-123' });
request.info('Processing', { endpoint: '/api/users' });

// Costs nothing when the level filters it out - the function is never called
logger.debug(() => `Expensive: ${computeHeavyValue()}`);
[2026-08-22T16:31:25.870Z] INFO: Application started
[2026-08-22T16:31:25.871Z] WARN: Config missing {"file":"config.json"}
[2026-08-22T16:31:25.872Z] ERROR: Query failed {"err":{"name":"Error","message":"timeout","stack":"..."}}
[2026-08-22T16:31:25.873Z] INFO: Processing {"requestId":"req-123","endpoint":"/api/users"}

Switch to format: 'json' and the same calls emit a structured envelope your log aggregator can parse.

Why this one

  • No dependencies. Not "few" — dependencies and peerDependencies are both empty in the published package.
  • The same code runs everywhere. One import, one API. The library detects Node, Deno, Bun, the browser or a web worker and picks an implementation.
  • Browser-safe by construction. The main entry contains no node: specifier at all, so bundling it for the browser cannot fail on an unresolvable built-in. That is enforced by where the code lives, not by a bundler shim.
  • Serialization that does not lose your data. Circular references, Error objects with their own properties, BigInt, Symbol, functions and deep nesting all survive — as markers where they must, in full where they can.
  • TypeScript native, with correct ESM and CJS types on every entry point.

Install

npm install logan-logger      # or pnpm add / yarn add
deno add jsr:@logan/logger    # or npx jsr add @logan/logger

Use named imports. There is no default export.

Upgrading from 1.x? See the migration guide. Winston is gone, file logging is opt-in, and repeated object references are no longer reported as [Circular].

Runtimes

| Runtime | Import | Notes | |---|---|---| | Auto-detect | logan-logger | Also the right choice for Next.js and other isomorphic frameworks | | Node.js 22.12+ | logan-logger/node | Adds the file transport and Morgan integration | | Bun | logan-logger/bun | Same as Node | | Browser / WebWorker | logan-logger/browser | CSS-styled console, performance marks, grouping | | Deno | jsr:@logan/logger | Console; native implementation planned |

Details and examples: docs/runtimes.md.

Configuring

createLogger({
  level: LogLevel.INFO,
  format: 'json',                    // or 'text'
  timestamp: true,                   // text form only
  colorize: false,                   // text form only, and only on a TTY
  metadata: { service: 'api' },      // attached to every record
  transports: [                      // omit for console only
    { type: 'console', options: {} },
    { type: 'file', level: LogLevel.ERROR, options: { filename: 'logs/error.log' } },
  ],
});

LOG_LEVEL, LOG_FORMAT, LOG_TIMESTAMP and LOG_COLOR override this at runtime, so an operator can turn up verbosity without a deploy. Libraries that need to pin their own logging set ignoreEnvironment: true.

Every field, every transport option, and the serialization rules: docs/configuration.md.

Documentation

Full documentation index

API documentation is generated from source on JSR.

Contributing

See CONTRIBUTING.md for setup, architecture and the release process.

This library is the reference implementation of Treering, a language-neutral logging specification with a conformance suite.

License

MIT © Logan Lindquist Land