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

adorable-log

v1.1.0

Published

Adorable Debug Library

Readme

adorable-log ❤️

console.log wrapper that makes browser debugging more adorable.

npm version npm downloads License: MIT

  • Namespace loggers - tag every log with a named badge so you can filter by module in DevTools
  • Auto color - deterministic HSL colors from namespace name; override anytime
  • Log levels - log, info, warn, error, success, debug
  • Groups - callback-based API that guarantees groupEnd is always called
  • Table - labeled console.table with optional column filtering
  • Banner - visually marks the start of a log flow
  • Global config - toggle logging per namespace or disable everything in production

Preview


Installation

npm install adorable-log
# or
pnpm add adorable-log
# or
yarn add adorable-log

Quick Start

import {create} from 'adorable-log';

const log = create('Auth');

log.log('Login attempt');
log.warn('Token expiring soon');
log.error('Authentication failed');
log.success('Login successful');

Project Setup

We recommend creating an alog.config.ts file at the project root to manage global configuration and loggers in one place.

// alog.config.ts
import {configure, create} from 'adorable-log';

configure({
  enabled: process.env.NODE_ENV !== 'production',
  namespaces: {
    Auth: {color: '#E74C3C'},
    Cart: {color: '#2ECC71', enabled: false},
    API: {color: '#3498DB'},
  },
});

export const authLog = create('Auth');
export const cartLog = create('Cart');
export const apiLog = create('API');
// Import only the loggers you need in each file
import {authLog} from '@/alog.config';

authLog.log('Login attempt');

You can also call create() directly without alog.config.ts.


Features

Namespace Logger

Create a dedicated logger per module. In the Chrome DevTools console filter, type [Auth] to show only logs from that namespace.

const log = create('Auth');

log.log('General message');     // [Auth] General message
log.info('Informational message'); // [Auth] ℹ️ Informational message
log.warn('Warning message');    // [Auth] ⚠️ Warning message
log.error('Error message');     // [Auth] ❌ Error message
log.success('Success message'); // [Auth] ✅ Success message
log.debug('Debug message');     // [Auth] 🔍 Debug message

| Method | Icon | Internal API | |-----------|------|-----------------| | log | | console.log | | info | ℹ️ | console.info | | warn | ⚠️ | console.warn | | error | ❌ | console.error | | success | ✅ | console.log | | debug | 🔍 | console.debug |


Automatic Color Assignment

If no color is specified, a color is auto-generated. The same name always produces the same color, even after a page refresh.

create('Auth');  // always the same color
create('Cart');  // always the same color
create('API');   // always the same color

You can also set a color explicitly.

// Set at create time
const log = create('Auth', {color: '#E74C3C'});

// Set in bulk via configure
configure({
  namespaces: {
    Auth: {color: '#E74C3C'},
    Cart: {color: '#2ECC71'},
  },
});

Priority: create option > configure namespace > auto-generated hash

Namespace colors from configure() apply even to loggers created before the call — call order doesn't matter. A color passed directly to create() always stays fixed.

The badge text color (white or black) is automatically determined.


Groups

Solves the problem of forgetting console.groupEnd and breaking console indentation, by using a callback-based API.

log.group('Payment Process', () => {
  log.log('Check stock');

  log.group('User Validation', () => {
    log.log('Check token');
    log.log('Check permissions');
  }); // groupEnd called automatically

  log.success('Payment complete');
}); // groupEnd called automatically

groupEnd is always called even if an error is thrown inside the callback.

The callback always runs even when logging is disabled — only the console grouping is skipped, so code inside a group never disappears in production.

Groups and tables are rendered collapsed by default (collapsed: true).

// collapsed option — render this group expanded
log.group('Label', () => { ...
}, {collapsed: false});

Table

Supports a label and column filtering.

const foods = [
  {name: '🍔', price: 30.89, group: 1},
  {name: '🍨', price: 20.71, group: 1},
  {name: '🍿', price: 10.31, group: 2},
];

// Label only
log.table('Foods', foods);

// Specific columns only
log.table('Foods', foods, ['name', 'price']);

Banner

Visually marks the start of a log flow.

log.banner('API Request Start');
// [API] | API Request Start |

Global Configuration

import {configure} from 'adorable-log';

configure({
  // Enable/disable all logging (default: true)
  enabled: process.env.NODE_ENV !== 'production',

  // Default collapsed state for group/table (default: true)
  collapsed: true,

  // Per-namespace settings
  namespaces: {
    Auth: {color: '#E74C3C'},
    Cart: {color: '#2ECC71', enabled: false}, // disable this namespace only
    API: {color: '#3498DB'},
  },
});

Usage Examples

React Hook

// hooks/useAuth.ts
import {authLog} from '@/alog.config';

export function useAuth() {
  const login = async (email: string) => {
    authLog.group('Login', () => {
      authLog.log({email});
      authLog.debug('Token request start');
    });

    const res = await loginApi(email);

    if (!res.ok) {
      authLog.error('Login failed');
    } else {
      authLog.success('Login successful');
    }
  };

  return {login};
}

API Client

// api/client.ts
import {apiLog} from '@/alog.config';

async function request(url: string, options: RequestInit) {
  apiLog.group(`${options.method} ${url}`, () => {
    apiLog.log({body: options.body});
  });

  const res = await fetch(url, options);

  if (!res.ok) {
    apiLog.error(`${res.status} ${res.statusText}`);
  } else {
    apiLog.success(`Response complete (${res.status})`);
  }

  return res;
}

Console Filtering

In the Chrome DevTools console filter input:
  [Auth]  → show only Auth logs
  [API]   → show only API logs

API

create(namespace, options?)

Creates a namespace logger instance.

| Parameter | Type | Description | |-----------------|----------|------------------------------| | namespace | string | Logger name | | options.color | string | Badge background color (hex) |

configure(options)

Updates global configuration.

| Option | Type | Default | Description | |--------------|-----------|---------|------------------------------------------| | enabled | boolean | true | Enable/disable all logging | | collapsed | boolean | true | Default collapsed state for group/table | | namespaces | object | {} | Per-namespace color and enabled settings |


License

License: MIT