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

@yash-devop/tinylog

v1.0.2

Published

Minimal request-scoped logging SDK for Node.js and Express.

Readme

TinyLogs

Minimal request-scoped logging SDK for Node.js and Express.

TinyLogs helps you create structured, grouped, colorful logs with request tracking using AsyncLocalStorage.


Features

  • Request-scoped logging
  • Express middleware support
  • Async context tracking
  • Structured logs
  • Colored CLI output
  • Tiny bundle size
  • TypeScript support
  • ESM + CommonJS support
  • Custom error handling

Installation

npm i @yash-devop/tinylogs

Peer dependency:

npm i express

Quick Start

Setup middleware

import express from "express";
import { tinylogs } from "@yash-devop/tinylogs";

const app = express();

app.use(express.json());
app.use(tinylogs());

Logging inside routes

import { useTinyLogs } from "@yash-devop/tinylogs";

app.get("/", async (req, res) => {
  const logger = useTinyLogs();

  logger.set({
    user: "Yash",
    role: "Fullstack Engineer",
  });

  logger.warn("Payment service latency detected");

  res.json({ success: true });
});

Example Output

April 26 at 11:14:58 PM [INFO] GET / in 56 ms
├─ requestId: 63cb2b9d-3b1d-46d4-b2e7-8e3f4c9c6e13
├─ user: Yash
├─ role: Fullstack Engineer
├─ Payment service latency detected

Error Logging

TinyLogs includes a built-in custom error class.

import { TinyLogError } from "@yash-devop/tinylogs";

throw new TinyLogError({
  message: "Payment Failed",
  status: 503,
  why: "Invalid payment id",
  fix: "Retry with valid payment credentials",
});

Error Middleware

import { errorMiddleware } from "@yash-devop/tinylogs";

app.use(errorMiddleware);

API

tinylogs()

Express middleware that initializes request-scoped logging.


useTinyLogs()

Returns logger methods:

const logger = useTinyLogs();

Methods

logger.set()

logger.set({
  user: "Yash",
});

logger.warn()

logger.warn("Something looks suspicious");

logger.error()

Used internally by TinyLogs error handling.


TypeScript Support

TinyLogs ships with built-in TypeScript types.

No additional typings required.


Example Project Structure

src/
├── middleware/
├── logger/
├── routes/
└── server.ts

Why TinyLogs?

Most loggers are either:

  • too noisy
  • hard to read
  • overly configurable
  • difficult to setup

TinyLogs focuses on:

  • simplicity
  • request grouping
  • clean developer experience
  • readable terminal output

Roadmap

  • Pretty log themes
  • File transports
  • JSON logging mode
  • Better async log grouping
  • Framework adapters
  • Browser/devtools support

License

MIT