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

yukino-ts

v0.0.7

Published

Lightweight Node.js Logger with Sync/Async Transport and Formatter support

Readme

Yukino Logger

A lightweight, flexible, and extendable logging library for Node.js, written in TypeScript.
Supports multiple log levels, synchronous/asynchronous transports, context-aware logging, and custom formatters.


Features

  • Log Levels: FATAL, ERROR, WARN, INFO, DEBUG, TRACE
  • Transports:
    • ConsoleTransport (sync)
    • AsyncConsoleTransport
    • FileTransport (sync)
    • AsyncFileTransport
  • Formatters:
    • PrettyFormatter (human-readable, colorized)
    • JsonFormatter (structured JSON)
    • Extendable for custom formats
  • Context Management:
    • Supports requestId, userId, sessionId, traceId, and custom keys
  • Safe Execution:
    • Wrap logging calls to avoid breaking application if a transport fails
  • Fully TypeScript typed
  • Async logging support for files or remote services
  • Structured JSON output for log aggregation tools

Installation

pnpm add yukino
# or
npm install yukino

Usage

Basic Logger

import { yukino } from "yukino-ts";

const logger = yukino.logger(yukino.LogLevel.DEBUG, [
  yukino.consoletransport(yukino.prettyformatter()),
]);

logger.info("Server started", { port: 3000 });
logger.error("Database connection failed", { retry: true });
logger.warn("Low memory warning");
logger.debug("Debugging details");
logger.fatal("Fatal error, shutting down");

Context-Aware Logging

const requestLogger = logger.withContext({
  requestId: "abc123",
  userId: "user42",
});

requestLogger.info("User request started");
requestLogger.error("User request failed", { endpoint: "/api/data" });

File Logging

import { yukino } from "yukino-ts";

const syncFileLogger = yukino.logger(yukino.LogLevel.INFO, [
  yukino.filetransport("./logs/app.log", yukino.prettyformatter()),
]);

const asyncFileLogger = yukino.logger(yukino.LogLevel.INFO, [
  yukino.asyncfiletransport("./logs/app_async.log", yukino.prettyformatter()),
]);

syncFileLogger.info("Sync file log example");
asyncFileLogger.info("Async file log example");

JSON Logging

import { yukino } from "yukino-ts";

const jsonLogger = yukino.logger(yukino.LogLevel.DEBUG, [
  yukino.asyncfiletransport("./logs/app.json", yukino.jsonformatter()),
]);

jsonLogger.debug("Structured JSON log", { sessionId: "sess123" });

Advanced Usage

Custom Formatter: Implement the Formatter interface to create your own log format.

Custom Transport: Extend SyncTransporter or AsyncTransporter to create transports (e.g., database, remote API).

Safe Execution: Use safeExecute to avoid breaking your app if a transport fails.

import { yukino } from "yukino-ts";

yukino.safeExecute(() => logger.info("This log is safe"), undefined);

Log Levels

| Level | Value | Description | | ----- | ----- | ------------------------------ | | FATAL | 0 | Critical errors, shutting down | | ERROR | 1 | Recoverable errors | | WARN | 2 | Warnings | | INFO | 3 | Informational messages | | DEBUG | 4 | Debug-level messages | | TRACE | 5 | Detailed tracing info |

Contributing

We welcome contributions to this project! If you would like to contribute, please follow these guidelines:

  1. Fork this repository: Create a personal fork of the repository on GitHub.
  2. Clone the fork: Clone the fork to your local machine and add the upstream repository as a remote.
    git clone https://github.com/info10/yukino.git
  3. Create a branch: Create a new branch for your changes.
    git checkout -b feature/your-feature-name
  4. Make your changes: Implement your changes in the new branch.
  5. Commit your changes: Commit your changes with a descriptive commit message.
    git commit -m "Description of your changes"
  6. Push to your fork: Push your changes to your forked repository.
    git push origin feature/your-feature-name
  7. Create a Pull Request: Open a pull request from your branch to the main repository's main branch. Provide a clear description of your changes and any relevant information.