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

@variablesoftware/logface

v0.7.3

Published

πŸŽ›οΈπŸͺ΅πŸ˜Ž A fun, lightweight, structured console-style logger with tag-based filtering for TypeScript projects.

Readme

@variablesoftware/logface πŸŽ›οΈπŸͺ΅πŸ˜Ž

Test Suite NPM version License Coverage Bundle Size Downloads PRs Welcome

πŸŽ›οΈπŸͺ΅πŸ˜Ž A fun, lightweight, structured console-style logger with tag-based filtering for TypeScript projects.


✨ Features

  • Drop-in replacements for console.* methods: debug, info, warn, error, log
  • Scoped tagging via log.options({ tag })
  • Filters logs using LOG or LOG_VERBOSE environment variables (supports wildcards)
  • Runtime log level: log.level = 'warn' or log.setLogLevel('warn') to suppress lower levels (unless LOG/LOG_VERBOSE is set)
  • Per-call configuration: timestamps, level formatting, and custom tags
  • Wildcard filtering support (e.g. auth:*, metrics*)
  • Global setup via log.setup({ ... })
  • Designed for Node.js and edge runtimes
  • Debug output is always gated: debug logs only appear if LOG/LOG_VERBOSE match, or if log.level is 'debug' and DEBUG=1 is set
  • log.level = 'silent' or log.setLogLevel('silent') suppresses all output
  • All log filtering logic falls back to LOG/LOG_VERBOSE if set, otherwise uses the runtime log level

πŸš€ Install

pnpm add @variablesoftware/logface

πŸ”§ Quick Usage

import { log } from "@variablesoftware/logface";

// Basic usage
log.debug("Boot sequence initiated");
log.info("App started on port %d", 3000);
log.warn("Disk usage at %d%%", 91);
log.error("Database connection failed: %s", err.message);

// Scoped/tagged logs
log.options({ tag: "auth" }).debug("User login event");
log.options({ tag: "metrics", timestamp: true }).info("Memory: %dMB", 182);
log.options({ tag: "api", levelShort: false }).warn("Rate limit exceeded");

// Global setup
log.setup({ timestamp: true, levelShort: false });

// Runtime log level (NEW)
log.level = "warn"; // Only warn, error, and log will be emitted
log.setLogLevel("error"); // Only error and log will be emitted
log.level = "silent"; // Suppress all output

// Restore to default
log.level = "debug";

πŸ“€ Output Format

[D][init] Booting...
[I][auth] Login successful
[L][metrics] 200 OK

Use log.setup() to enable timestamps or full level names.


πŸ” Filtering

Use LOG or LOG_VERBOSE to filter logs by tag or level:

LOG=auth node app.js
LOG=metrics,debug,auth* node app.js
LOG="!foo;auth,debug" node app.js   # Negation: suppress 'foo' unless also matches 'auth' or 'debug'
  • Wildcards are supported (e.g. auth:*, metrics*).
  • Negation is supported: Prefix a pattern with ! to suppress logs matching that pattern, unless also matched by a positive pattern. Example: LOG="!foo;auth,debug" suppresses logs with tag foo unless they also match auth or debug.
  • If neither is set, you can control output at runtime:
log.level = "warn"; // Only warn, error, and log
log.level = "silent"; // Suppress all output

Debug logs are only shown if LOG/LOG_VERBOSE match, or if log.level is 'debug' and DEBUG=1 is set in the environment.


πŸ“š Full Guide

For wildcard matching, structured output, test helpers, global setup, and advanced filtering:

➑️ See LOGGING.md for full logging level guidance


πŸ“„ License

MIT Β© Rob Friedman / Variable Software


Built with ❀️ by @variablesoftware
Thank you for downloading and using this project. Pull requests are warmly welcomed!


🌐 Inclusive & Accessible Design

  • Naming, logging, error messages, and tests avoid cultural or ableist bias
  • Avoids assumptions about input/output formats or encodings
  • Faithfully reflects user data β€” no coercion or silent transformations
  • Designed for clarity, predictability, and parity with underlying platforms (e.g., Cloudflare APIs)
  • Works well in diverse, multilingual, and inclusive developer environments

Logface Configuration

Logface supports powerful customization via a config file. You can control emoji, color, and more for your log output.

Quick Start

  1. Copy the example config:
    cp logface.example.config.js logface.config.js
  2. Edit logface.config.js to your liking.

Example: Multiple Emoji Sets & Randomization

// logface.config.js
module.exports = {
  emojiRandom: true, // Random emoji per log message
  emojis: {
    debug: ["πŸ›", "πŸ”", "🦠"],
    info: ["ℹ️", "πŸ’‘", "🧭"],
    log: ["πŸ“", "πŸ“„", "πŸ—’οΈ"],
    warn: ["⚠️", "🚧", "πŸ›‘"],
    error: ["πŸ”₯", "πŸ’₯", "πŸ’£"],
  },
  colorEnabled: true, // Enable/disable color
  colorLibrary: "chalk", // 'chalk', 'picocolors', 'colorette', or 'kleur'
};

Disabling Emoji/Color in Tests

Logface disables emoji and color automatically during tests for stable output. You can also set these manually:

module.exports = {
  emojiRandom: false,
  emojis: { debug: "", info: "", log: "", warn: "", error: "" },
  colorEnabled: false,
};

Supported Config Options

  • emojiRandom: true for random emoji per log, false for fixed.
  • emojis: Object mapping log levels to emoji (array or string).
  • colorEnabled: Enable/disable color output.
  • colorLibrary: Choose color library: 'chalk', 'picocolors', 'colorette', 'kleur'.

.js vs .mjs

  • Use .js for CommonJS or ESM (depends on your package.json type).
  • Use .mjs for guaranteed ESM.

Example: ESM Config

// logface.config.mjs
export default {
  emojiRandom: true,
  emojis: {
    debug: ["πŸ›", "πŸ”", "🦠"],
    info: ["ℹ️", "πŸ’‘", "🧭"],
    log: ["πŸ“", "πŸ“„", "πŸ—’οΈ"],
    warn: ["⚠️", "🚧", "πŸ›‘"],
    error: ["πŸ”₯", "πŸ’₯", "πŸ’£"],
  },
  colorEnabled: true,
  colorLibrary: "picocolors",
};

Tips

  • Add logface.config.js to your .gitignore to avoid committing user-specific config.
  • See logface.example.config.js for a template.

For more, see LOGGING.md.