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

moologger

v1.0.4

Published

A simple, beautiful and easy to use logger!

Readme

MooLogger

Version License PRs Prettier

A simple, beautiful, and easy-to-use logger!

Getting Started

It's pretty straightforward:

const { MooLogger } = require("moologger")

const logger = new MooLogger()
logger.info("Hello world!")

Configuration can be done in the constructor:

new MooLogger({
  logLevel: 4,
  /*
      0: disabled,
      1: fatal,
      2: error,
      3: warn,
      4: info,
      5: debug,
      default: 4
    */
  logFolder: "path/to/folder", // The directory where the logger stores logs
  timestamp: true, // Display timestamp? (true by default)
  lang: {
    debug: "DEBUG",
    info: "INFO",
    warn: "WARN",
    error: "ERROR",
    fatal: "FATAL",
  }, // You can customize badge strings like this
})

Available functions

logger.debug(...data)
logger.info(...data)
logger.warn(...data)
logger.error(...data)
logger.fatal(...data)

It just works:tm:, like the built-in console.

Examples

The most simple usage you can possibly think of:

const logger = new MooLogger()

// info & debug
logger.info("Important", "data")
logger.debug("$ Pay Taxes $")

// warn
logger.warn(
  "`--global`, `--local` are deprecated.",
  {
    reason: "I'm telling you anyway."
  }
)

// error & fatal
const error = new Error("I don't know what happened")
logger.error(error, "This error was not my fault!")

try {
  (function shake() {shake()})()
} catch (earthquakeError) {
  logger.fatal(earthquakeError, "EARTHQUAKE DETECTED! STOPPING PROGRAM...")
}

Setting the log level — you can think of it as "filtering" levels.

const { LogLevel } = require("moologger")

const logger = new MooLogger({
  /*
    {
      DISABLED: 0,
      FATAL: 1,
      ERROR: 2,
      WARN: 3,
      INFO: 4,
      DEBUG: 5
    }
  */

  logLevel: LogLevel.WARN
  // levels below WARN (INFO, DEBUG) won't be logged
})

logger.warn("Hello!") // logged
logger.fatal("ANOTHER EARTHQUAKE!") // logged
logger.info("Paid taxes") // not logged

You can set the badge text that corresponds to the log level.

If a field is not set, it'll be replaced with the default one.

const lang = {
  /* It's just like i18n */
  debug: "Bug Killer",
  info: "πληροφορίες",
  warn: "uyarı",
  error: "ข้อผิดพลาด",
  fatal: "致命的な誤り"
}

new MooLogger({ lang }) // register it

As the name implies, a log folder (directory) stores logs from MooLogger. Log files are named as the current timestamp.

If not set, MooLogger will disable this feature.

new MooLogger({
  logFolder: "path/to/dir"
})

If you prefer logging into one fixed (singular) file, use logFile instead.

Same as logFolder, MooLogger will disable this feature if not set.

new MooLogger({
  logFile: "my.log"
})

Note that DO NOT set logFolder and logFile at the same time, you have to choose between them. Life is so cruel!