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

@yadah/subsystem-logger

v0.2.0

Published

Yadah subsystem to provide a shared logger

Readme

Yadah Logger subsystem

A Yadah subsystem and Domain class mixin that provides a logging using winston.

Basic usage

import createLogger, { LoggerMixin } from "@yadah/subsystem-logger";
import DataManager, { Domain } from "@yadah/data-manager";
import { pipe } from "@yadah/mixin";

class MyDomain extends pipe(Domain, LoggerMixin) {
  foo() {
    this.logger.info("foo() was called");
  }

  err() {
    try {
      throw new Error("error message");
    } catch (error) {
      this.logger.error("err() threw", error);
    }
  }
}

const logger = createLogger({ pretty: true, silent: false, level: "info" });

const dataManager = new DataManager({ logger });
const domains = dataManager.boot({ MyDomain });

domains.MyDomain.foo();
// info: foo() was called {timestamp}

domains.MyDomain.err();
// error: err() threw {timestamp}
// Error: error message
//   {stack}

Logging types

The logger instance provides access to syslog, npm, and cli logging types.

logger.syslog.warning("A syslog style warning");
logger.cli.help("A help message");
logger.npm.http("request", request);

The options.level option may be set to a comma-separated list of levels. Each logging type will use the first level that the logger supports. For example, to output only syslog "alert" and above messages and otherwise "error" messages, set { level: "alert,error" }. To get all levels for each type use { level: "silly,debug" }.

Log formats

The logger has two formats:

  • pretty
  • json

In each format, the log functions accept arguments in the form:

logger.info(message: string, ...metaData: any[]);

Note: No string interpolation is performed.

The "pretty" format is intended for development environments. It will display the message and each metaData item as colorized output. Error objects are displayed with a stack trace.

The "json" format is intended for production environments where logs are captured in a centralized logging tool. Error objects are captured with a stack trace.

createLogger(options)

Creates a winston logger configured to output logs to the console.

Options:

  • pretty - set to true in development to output readable logs; set to false in production to output JSON content more suitable for machine consumption
  • silent - set to true to suppress all log output
  • level - only log messages at or above this level will be output; set to "silly,debug" to get maximum logs; default is "info"

LoggerMixin

The LoggerMixin function will add a .logger property to domain classes which provides access to the logger instance.