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

@hunab/chromalog

v0.2.0

Published

Pretty console badges for the browser. Tiny TypeScript logger with colored levels and URL-driven config.

Readme

chromalog — Pretty Console Badges for the Browser (TypeScript)

npm version npm downloads bundle size types license

chromalog is a tiny, dependency-free logger that prints colored, badge-style messages in the browser console. It helps you quickly scan successes, infos, warnings and errors in large traces. Built in TypeScript.

Keywords: browser console logger, colored console logs, styled console, TypeScript logger, React logger, JavaScript logging utility, console badges, pretty logs, console formatter, logging library for frontend.


Features

  • Colored badges per level: success, info, warning, error.
  • ✅ Uses the right console method per level (console.info, console.warn, console.error).
  • Level icons (✅ ℹ️ ⚠️ 🛑) for faster scanning.
  • Auto light/dark theme based on prefers-color-scheme.
  • Enable/disable globally via chromalog.config({ enabled: false }).
  • ✅ Zero dependencies, TypeScript typings, tiny footprint.

Install

npm i @hunab/chromalog
# or
yarn add @hunab/chromalog
# or
pnpm add @hunab/chromalog

CDN:

<script type="module">
  import { chromalog } from 'https://unpkg.com/@hunab/chromalog/dist/index.es.js';
  chromalog.info('Hello from CDN!');
</script>

Quick Start

import { chromalog } from '@hunab/chromalog';

chromalog.success('User registered successfully!');
chromalog.info('Fetching data from the API...');
chromalog.warning('The session token will expire soon.');
chromalog.error('Error connecting to the server.');

Customize Styles

chromalog.config({
  styles: {
    success: 'color:white;background:forestgreen;padding:2px 8px;border-radius:4px;',
    info: 'color:white;background:dodgerblue;padding:2px 8px;border-radius:4px;',
    warning: 'color:black;background:orange;padding:2px 8px;border-radius:4px;',
    error: 'color:white;background:crimson;padding:2px 8px;border-radius:4px;'
  }
});

chromalog.success('Custom style applied!');

Disable / Enable (Production Toggle)

Silence logs globally (e.g., on production):

chromalog.config({ enabled: false }); // disable all styled logs
// later...
chromalog.config({ enabled: true }); // re-enable

You can wire this to your build env:

chromalog.config({ enabled: import.meta.env.DEV });

URL-Driven Config (for demos)

Tweak styles without changing code during demos:

  • ?styled=0 → disables styles.
  • ?success=color:purple;font-weight:bold; → overrides the success badge CSS.

Demo handler (already used in the demo app):

const params = new URLSearchParams(location.search);
if (params.get('styled') === '0') chromalog.config({ styled: false });
const successStyle = params.get('success');
if (successStyle) chromalog.config({ styles: { success: successStyle } });

Optional quick links for your demo page:

<p>
  Try:
  <a href="?styled=0">?styled=0</a> |
  <a href="?success=color:purple;font-weight:bold;">?success=purple+bold</a>
</p>

API

type Level = 'success' | 'error' | 'warning' | 'info';
type StyleMap = Record<Level, string>;

interface Config {
  styled: boolean;
  enabled: boolean;
  styles: StyleMap;
}

type ConfigUpdate = {
  styled?: boolean;
  enabled?: boolean;
  styles?: Partial<StyleMap>;
};

// Update config (styles supports partial updates)
chromalog.config(options: ConfigUpdate);
chromalog.enable();  // enable styled logs
chromalog.disable(); // disable styled logs

// Methods
chromalog.success(...args: any[]): void;
chromalog.info(...args: any[]): void;
chromalog.warning(...args: any[]): void;
chromalog.error(...args: any[]): void;
chromalog.log(...args: any[]): void; // raw console.log passthrough

Screenshot


Browser Support

chromalog uses the %c console formatter, supported by all modern browsers (Chrome, Edge, Firefox, Safari). If a browser doesn’t support %c, it will fall back to plain text.


Contributing

  • Fork → create branch → PR (add tests/examples when relevant).
  • Follow Conventional Commits (feat:, fix:, docs:, chore:…).
  • Run npm run build before opening the PR.

Roadmap

  • Namespaces and filters (e.g. auth:*, cart:*).
  • Optional Node/React Native ANSI fallback.
  • Grouped logs and lightweight timers.
  • Theme presets (ocean / sunset / mono).

License

MIT © 2025 Hunab Labs