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

logora-console

v1.1.2

Published

Console output plugin for Logora – renders logs to stdout with colors, scopes, and timestamps.

Readme

logora-console

NPM version

logora-console is the official console output module for the Logora logging framework.

It formats and displays logs in the terminal with dynamic templating, optional styling, and structured customization per log type or section.


Features

  • Rich ANSI color support (toggle via useColors)
  • Custom timestamp formatting (via Moment.js)
  • Dynamic formatString templating (%type%, %message%, etc.)
  • Conditional block rendering ({scope: %scope%} is hidden if undefined)
  • Fine-grained control over style per field (message, scope, timestamp, type)
  • Per-log-type style overrides (e.g. different color for error, warning, etc.)
  • Non-blocking design with full support for scoped loggers

Installation

npm install logora logora-console

Basic Usage

import { createLogger, LogLevel } from "logora";
import { createConsoleOutput } from "logora-console";

const logger = createLogger({ level: LogLevel.Info });

logger.addLogOutput(createConsoleOutput());

logger.info("Server started on port {0}", 3000);

Scoped Logging

You can create scoped loggers using getScoped():

const dbLogger = logger.getScoped("Database");

dbLogger.debug("Connection opened.");
dbLogger.error("Query failed: {0}", error.message);

This scope will appear in your formatString if defined via %scope%.


Format String

You control the output structure using a formatString.

Supported placeholders:

  • %timestamp%
  • %scope%
  • %type%
  • %message%

Conditional blocks:

  • {scope: %scope% - } will be rendered only if scope is defined
  • You can nest or mix blocks and separators

Example:

createConsoleOutput({
  formatString: "[%timestamp%] {scope: %scope% | }%type%: %message%"
});

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | formatString | string | [%timestamp%] %type%: %message% | The template used to format each log line | | useColors | boolean | true | Enable or disable ANSI colors | | logFormat.timestamp.format | string | "HH:mm:ss" | Timestamp format (Moment.js) | | logFormat.timestamp.color | ConsoleColor | gray | Timestamp color | | logFormat.scope.color | ConsoleColor | cyan | Scope label color | | logFormat.scope.modifier | Modifier | — | capitalize, uppercase, or lowercase | | logFormat.type.color | ConsoleColor | bright | Default log type color | | logFormat.type.error.color | ConsoleColor | red | Color used for errors | | logFormat.type.warning.color | ConsoleColor | yellow | Color for warnings | | logFormat.message.color | ConsoleColor | white | Color for log message content | | logFormat.message.modifier | Modifier | — | Casing transformation | | logFormat.text.color | ConsoleColor | reset | Color applied after any colored segment | | logFormat.dailyDateHeader.formatString | string | [%dailyDate%] | Template for daily headers | | logFormat.dailyDateHeader.format | string | YYYY-MM-DD | Moment format for date headers |


Advanced Styling

Each section can be styled with modifiers and custom colors:

createConsoleOutput({
  formatString: "[%timestamp%] {scope: %scope% | }%type%: %message%",
  logFormat: {
    timestamp: { format: "HH:mm:ss", color: "\x1b[90m" },
    scope: { color: "\x1b[36m", modifier: "capitalize" },
    type: {
      color: "\x1b[37m",
      error: { color: "\x1b[31m", modifier: "uppercase", argsColor: "\x1b[35m" },
      warning: { color: "\x1b[33m" }
    },
    message: { color: "\x1b[37m", modifier: "uppercase" },
    text: { color: "\x1b[0m" }
  }
});

License

MIT © Sébastien Bosmans