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

kixx-logger

v3.0.0

Published

A logger for HTTP application servers built with JavaScript (Node.js, Deno, etc).

Readme

Kixx Logger

A logger for HTTP application servers built with JavaScript (Node.js, Deno, etc).

Created by Kris Walker 2017 - 2025.

Principles

  • No dependencies: A logger is a low level primitive component which systems depend on and should NOT complicate matters by having dependencies itself.
  • Provide rich and indexable information: Logs should be output in structured data formats which can be leveraged by other tools for analysis.

Features

  • Multilevel logging (DEBUG, INFO, WARN, ERROR)
  • Named child loggers with inheritance
  • Dynamic log level and mode configuration
  • Multiple output modes (console, stdout)
  • Structured logging with support for additional info and error objects

Installation

npm install kixx-logger

Environment Support

| Env | Version | |---------|------------| | ECMA | >= ES2022 | | Node.js | >= 16.13.2 | | Deno | >= 1.0.0 |

This library is designed for use in an ES6 module environment requiring Node.js >= 16.13.2 or Deno >= 1.0.0. You could use it in a browser, but there are no plans to offer CommonJS or AMD modules. It targets at least ES2022 and uses the optional chaining operator ?..

If you're curious: Node.js >= 16.13.2 is required for ES6 module stabilization and ES2022 support.

Note: There is no TypeScript here. It would be waste of time for a library as small as this.

Usage

import Logger from 'kixx-logger';

// Create a logger with a name
const logger = new Logger({ name: 'my-app' });

// Log messages at different levels
logger.debug('Debug message');
logger.info('Info message');
logger.warn('Warning message');
logger.error('Error message');

Additional Information and Errors

You can include additional information and error objects with your log messages:

// Log with additional info
logger.info('User action', { userId: 123, action: 'login' });

// Log with error
try {
    // ... some code that might throw
} catch (error) {
    logger.error('Operation failed', null, error);
}

// Log with both info and error
logger.error('Failed to process user', { userId: 123 }, error);

Log Levels

The logger supports four levels of logging:

| Level Name | Level Integer | Description | |------------|---------------|-------------| | DEBUG | 10 | Detailed debugging information | | INFO | 20 | General operational information | | WARN | 30 | Warning messages for potentially harmful situations | | ERROR | 40 | Error events that might still allow the application to continue running |

Configuration Options

When creating a logger, you can specify the following options:

const logger = new Logger({
    name: 'my-app',      // Required: A string identifier for the logger
    level: 'INFO',       // Optional: Logging level (default: 'INFO')
    mode: 'stdout'       // Optional: Output mode (default: 'stdout')
});

Child Loggers

Create child loggers that inherit settings from their parent:

const parent = new Logger({ name: 'parent' });
const child = parent.createChild('child');

// Child logger inherits parent's level and mode
child.info('Message from child logger'); // Output: "parent:child - Message from child logger"

Output Modes

The logger supports two output modes:

  1. stdout (default): Structured output suitable for production environments

    • ISO timestamp
    • Log level
    • Process ID
    • Logger name
    • Message
    • Additional info (JSON)
    • Error details (JSON)
  2. console: Human-readable output suitable for development

    • Human-readable timestamp
    • Log level
    • Logger name
    • Message
    • Additional info
    • Error details

API Reference

Constructor

new Logger(options)

Options

  • name (string, required): Logger identifier
  • level (string|number, optional): Logging level
  • mode (string, optional): Output mode ('stdout' or 'console')

Properties

level

Get or set the logging level:

// Get current level
const currentLevel = logger.level;

// Set level using string
logger.level = 'DEBUG';

// Set level using integer
logger.level = 10; // DEBUG level

mode

Get or set the output mode:

// Get current mode
const currentMode = logger.mode;

// Set mode
logger.mode = 'console';

Methods

createChild(name)

Creates a child logger that inherits settings from the parent.

const child = logger.createChild('child-name');

debug(message, info, error)

info(message, info, error)

warn(message, info, error)

error(message, info, error)

Log messages at different levels with optional additional information and error objects.

logger.debug('Debug message', { context: 'value' });
logger.info('Info message', { userId: 123 });
logger.warn('Warning message', null, error);
logger.error('Error message', { context: 'value' }, error);

Copyright and License

Copyright: (c) 2017 - 2025 by Kris Walker (www.kriswalker.me)

Unless otherwise indicated, all source code is licensed under the MIT license. See LICENSE for details.