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

saxoph

v1.0.0

Published

A lightweight, extensible, TypeScript-first logging library.

Readme

saxoph

A lightweight, extensible, TypeScript-first logging library for Node.js applications.

Why Another Logger?

There are already many excellent logging libraries available, such as Pino and Winston. However, Saxoph was built with a different set of goals:

  • Simple and predictable API
  • TypeScript-first design
  • Minimal dependencies
  • Extensible architecture
  • Easy to understand and customize
  • Suitable for learning how logging systems work internally
  • Production-ready foundations without unnecessary complexity

The focus is on providing a clean logging experience while keeping the internal architecture approachable and maintainable.


Features

  • Multiple log levels
  • Console transport
  • File transport
  • JSON formatter
  • Pretty formatter
  • Child loggers
  • Structured metadata
  • Error serialization
  • Multiple transports
  • TypeScript support

Installation

npm install saxoph

Quick Start

import { createLogger } from 'saxoph';

import { createConsoleTransport } from 'saxoph/transports';
import { prettyFormatter } from 'saxoph/formatters';

const logger = createLogger({
  transports: [createConsoleTransport(prettyFormatter)],
});

logger.info('Application started');

Example output:

[2026-05-31T10:00:00.000Z] INFO Application started

Log Levels

Supported log levels:

trace
debug
info
warn
error
fatal

Configure the minimum log level:

const logger = createLogger({
  level: 'warn',
  transports: [createConsoleTransport(prettyFormatter)],
});

Only logs at warn level and above will be emitted.


Metadata

Attach structured metadata to log entries.

logger.info('User created', {
  userId: '123',
  email: '[email protected]',
});

Child Loggers

Create child loggers that automatically include additional metadata.

const logger = createLogger({
  transports: [createConsoleTransport(prettyFormatter)],
});

const requestLogger = logger.child({
  requestId: 'req-123',
});

requestLogger.info('Request started');
requestLogger.info('Request completed');

Every log emitted by the child logger includes the provided metadata.


Error Logging

Errors are automatically serialized.

try {
  throw new Error('Database connection failed');
} catch (error) {
  logger.error('Unable to connect to database', {
    error,
  });
}

Example output:

{
  "level": "error",
  "message": "Unable to connect to database",
  "metadata": {
    "error": {
      "name": "Error",
      "message": "Database connection failed",
      "stack": "..."
    }
  }
}

JSON Formatter

Use structured JSON logs for production environments.

import { createLogger } from 'saxoph';

import { createConsoleTransport } from 'saxoph/transports';
import { jsonFormatter } from 'saxoph/formatters';

const logger = createLogger({
  transports: [createConsoleTransport(jsonFormatter)],
});

Example output:

{
  "level": "info",
  "message": "Application started",
  "timestamp": "2026-05-31T10:00:00.000Z"
}

Pretty Formatter

Human-friendly logs for local development.

import { createLogger } from 'saxoph';

import { createConsoleTransport } from 'saxoph/transports';
import { prettyFormatter } from 'saxoph/formatters';

const logger = createLogger({
  transports: [createConsoleTransport(prettyFormatter)],
});

Example output:

[2026-05-31T10:00:00.000Z] INFO Application started

File Transport

Write logs to a file.

import { createLogger } from 'saxoph';

import { createFileTransport } from 'saxoph/transports';
import { jsonFormatter } from 'saxoph/formatters';

const logger = createLogger({
  transports: [
    createFileTransport({
      path: './logs/app.log',
      formatter: jsonFormatter,
    }),
  ],
});

Directories are created automatically if they do not exist.


Multiple Transports

Send logs to multiple destinations simultaneously.

const logger = createLogger({
  transports: [
    createConsoleTransport(prettyFormatter),
    createFileTransport({
      path: './logs/app.log',
      formatter: jsonFormatter,
    }),
  ],
});

A single log event can be written to both the console and a file at the same time.


Public API

Core

import { createLogger } from 'saxoph';

Transports

import { createConsoleTransport, createFileTransport } from 'saxoph/transports';

Formatters

import { jsonFormatter, prettyFormatter } from 'saxoph/formatters';

Example Project Setup

import { createLogger } from 'saxoph';

import { createConsoleTransport, createFileTransport } from 'saxoph/transports';

import { prettyFormatter, jsonFormatter } from 'saxoph/formatters';

export const logger = createLogger({
  level: 'info',
  transports: [
    createConsoleTransport(prettyFormatter),
    createFileTransport({
      path: './logs/app.log',
      formatter: jsonFormatter,
    }),
  ],
});

Roadmap

Future enhancements may include:

  • Log file rotation
  • Log retention policies
  • Colorized console output
  • Async transports
  • HTTP transports
  • Trace and span identifiers
  • OpenTelemetry integration
  • Custom timestamp formatting

License

MIT License. See LICENSE for details.