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

loggest

v1.0.8

Published

A flexible, minimalistic logging utility package,

Readme

loggest

npm version downloads types license

A lightweight, dependency-free logging utility that's fast, flexible, and easy to extend. Build structured logs your way with a simple plugin-based architecture.

Installation

npm install loggest

Quick Start

Set up a logger with the built-in console plugin:

import { Logger } from "loggest";

const logger = new Logger({
    plugins: [
        {
            handle: (level, context, message, ...optional) => {
                console.log(level, message, ...optional);
            },
        },
    ],
});

logger.info({ name: "app", version: "1.0" });
logger.info("Application started", "additional info");

Features

  • Lightweight – No dependencies, minimal footprint
  • Plugin-based – Mix and match logging destinations
  • Structured logging – Built-in support for context and metadata
  • Flexible – File, console, API, or custom logging destinations
  • Configurable – Control log levels, formatting, and filtering
  • Type-safe – Full TypeScript support

Configuration

Here's a more complete example with multiple plugins and custom options:

import { Logger } from "loggest";
import FileLog from "loggest/dist/plugins/FileLog";
import ApiLog from "loggest/dist/plugins/ApiLog";

const logger = new Logger({
    levels: ["info", "warn", "error"],
    plugins: [new FileLog(), new ApiLog({ url: "https://example.com/logs" })],
    context: { app: "my-app", env: "production" },
    format: (level, ctx, msg, ...rest) => `[${level}] ${msg}`,
    filter: (level) => level !== "debug",
});

logger.info("Server initialized");
logger.warn("High memory usage detected");
logger.error("Connection failed");

Using Built-in Plugins

The package includes several ready-to-use plugins:

FileLog – Write logs to a file

import FileLog from "loggest/dist/plugins/FileLog";

const logger = new Logger({
    plugins: [new FileLog()],
});

ApiLog – Send logs to a remote endpoint

import ApiLog from "loggest/dist/plugins/ApiLog";

const logger = new Logger({
    plugins: [new ApiLog({ url: "https://example.com/logs" })],
});

ConsoleLog – Output to the console

import ConsoleLog from "loggest/dist/plugins/ConsoleLog";

const logger = new Logger({
    plugins: [new ConsoleLog()],
});

Creating Custom Plugins

You can create plugins as objects or classes to handle logs however you need.

Object-based plugin:

const databaseLogger = {
    handle: async (level, ctx, message, ...optional) => {
        await db.logs.insert({ level, message, timestamp: new Date() });
    },
};

const logger = new Logger({ plugins: [databaseLogger] });

Class-based plugin:

export class ColoredConsoleLog {
    async handle(level, ctx, message, ...optional) {
        const colors = {
            info: "\x1b[36m",
            warn: "\x1b[33m",
            error: "\x1b[31m",
            debug: "\x1b[90m",
        };
        const color = colors[level] || "";
        console.log(`${color}[${level}]\x1b[0m ${message}`, ...optional);
    }
}

const logger = new Logger({ plugins: [new ColoredConsoleLog()] });

With TypeScript types:

import { LogLevel, Plugin } from "loggest";

export class MyCustomLogger implements Plugin {
    async handle(level: LogLevel, ctx: any, message: any, ...optional: any[]): Promise<void> {
        // Your custom logging logic here
    }
}

Contributing

We welcome contributions! To get started:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT © Saeed Hosan