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

@rudranarayan01/logaccent

v0.1.0

Published

Developer-friendly terminal styling and semantic logging for JavaScript and TypeScript.

Readme

logAccent

A developer-first logging toolkit for Node.js and TypeScript.

logAccent combines expressive terminal styling with structured logging, scoped loggers, timing utilities, and secure object formatting. It is designed for developers who want logs that are easier to identify, easier to debug, and easier to maintain.

Unlike color-only libraries, logAccent provides semantic logging primitives that scale from small scripts to large backend services.


Features

  • Chainable terminal styling
  • Semantic log levels
  • Scoped loggers
  • High-resolution performance timers
  • Context-aware logging
  • Sensitive data redaction
  • Hex and RGB color support
  • Automatic terminal color detection
  • ESM and CommonJS support
  • TypeScript support
  • Zero runtime dependencies
  • Tree-shakeable exports
  • Production-friendly architecture

Installation

npm install @rudranarayan/logaccent

Quick Start

import { accent, logger } from "@rudranarayan01/logaccent";

console.log(accent.red("Database connection failed"));

logger.success("Server started");
logger.info("Listening on port 3000");
logger.warn("Memory usage is increasing");
logger.error("Unable to connect to Redis");

Terminal Styling

Basic colors

console.log(accent.red("Error"));
console.log(accent.green("Success"));
console.log(accent.yellow("Warning"));
console.log(accent.blue("Information"));
console.log(accent.magenta("Custom"));
console.log(accent.cyan("Request"));

Multiple styles

console.log(
    accent.red.bold.underline("Critical error")
);

console.log(
    accent.bgRed.white.bold(" FATAL ")
);

Custom colors

console.log(
    accent.rgb(255, 120, 50)("Orange")
);

console.log(
    accent.hex("#7C3AED")("Purple")
);

Semantic Logging

logger.fatal("Application failed to start");

logger.error("Database connection failed");

logger.warn("Redis latency is high");

logger.success("Deployment completed");

logger.info("Server listening");

logger.debug("Incoming payload", payload);

logger.trace("Entered payment handler");

Scoped Loggers

Scopes help organize logs across different modules.

const authLog = logger.scope("AUTH");

authLog.info("Authentication started");

authLog.success("User authenticated");

Nested scopes

const apiLog = logger.scope("API");

const paymentLog =
    apiLog.scope("PAYMENT");

paymentLog.info("Creating payment intent");

Example output

[API:PAYMENT] INFO Creating payment intent

Performance Timers

Measure execution time without additional utilities.

const timer =
    logger.time("Database query");

await fetchUsers();

timer.end();

Example

SUCCESS Database query completed in 42.13ms

Logging Context

Attach shared metadata to every log.

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

requestLogger.info("Request received");

Sensitive Data Redaction

Mask confidential information before logging.

import {
    logger,
    redact
} from "@rudranarayan/logaccent";

logger.info(
    "Authentication payload",
    redact({
        email: "[email protected]",
        password: "secret",
        accessToken: "abc123"
    })
);

Output

{
  "email": "[email protected]",
  "password": "[REDACTED]",
  "accessToken": "[REDACTED]"
}

Creating a Custom Logger

import {
    createLogger
} from "@rudranarayan/logaccent";

const log =
    createLogger({
        scope: "DATABASE",
        level: "debug"
    });

log.info("Executing query");

Production Configuration

Development

const logger =
    createLogger({
        level: "debug"
    });

Production

const logger =
    createLogger({
        level: "warn"
    });

This keeps warnings and errors while reducing unnecessary console noise in production.


TypeScript

logAccent is written in TypeScript and includes bundled type definitions.

import {
    accent,
    logger,
    createLogger
} from "@rudranarayan/logaccent";

No additional configuration is required.


Browser Support

The styling API works in Node.js terminals.

For browser environments, colors are omitted automatically while preserving the same API surface.


API

Styling

accent.red()
accent.green()
accent.yellow()
accent.blue()
accent.magenta()
accent.cyan()
accent.white()
accent.gray()

accent.bold()
accent.italic()
accent.underline()
accent.dim()
accent.inverse()
accent.strikethrough()

accent.bgRed()
accent.bgBlue()
accent.bgGreen()

accent.rgb()
accent.bgRgb()

accent.hex()
accent.bgHex()

Logger

logger.fatal()

logger.error()

logger.warn()

logger.success()

logger.info()

logger.debug()

logger.trace()

logger.scope()

logger.withContext()

logger.time()

Design Goals

logAccent is built around a few simple principles.

  • Keep the API small and expressive.
  • Prefer semantic logging over raw console output.
  • Preserve type safety.
  • Avoid runtime dependencies.
  • Respect production environments.
  • Make debugging faster through structured output.

Roadmap

Planned features include:

  • Log tables
  • Highlight helpers
  • Diff viewer
  • Boxed messages
  • Progress indicators
  • File transport
  • JSON transport
  • Browser console themes
  • React Native adapter

Contributing

Issues, feature requests, and pull requests are welcome.

If you have an idea that improves developer experience without increasing unnecessary complexity, feel free to open a discussion.


License

MIT