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

@janez89/logger

v1.0.0

Published

Minimalist simple Log4j like logger for NodeJS

Downloads

54

Readme

Minimalist Logger

A minimalist logger for Node.js. Log output format is something like Java Log4j format.

This is a stdout / stderr only logger. If you need more of this, then check out other loggers.

Supports both ESM and CommonJS module systems.

Environment variables

  • LOG_LEVEL - Log level. Default: DEBUG. Possible values: DEBUG, INFO, WARN, ERROR.
  • ROOT_LOGGER_NAME - Root logger name. Default: app.

Usage

import logger from '@janez89/logger';

logger.info('Hello world from App Logger!');

Output:

2025-12-17 13:19:19.546  INFO 74822 --- app: Logger initialized. Global log level: DEBUG. Node version: v22.15.0
2025-12-17 13:19:19.546 DEBUG 74822 --- app: Use LOG_LEVEL=INFO to decrease verbosity. Supported values: DEBUG, INFO, WARN, ERROR
2025-12-17 13:19:19.546  INFO 74822 --- app: Hello world from App Logger!
import { getLogger } from '@janez89/logger';

const logger = getLogger('namespaced-logger');

logger.debug('Doing something...', { foo: 'bar' });
logger.info('Hello world from namespaced Logger!');
logger.warn('Something is not right...');
logger.error('Something went wrong!', new Error('Oops!'));
logger.log('INFO', 'Parameterized log level');

Output:

2025-12-17 15:17:39.775  INFO 79680 --- app: Logger initialized. Global log level: DEBUG. Node version: v22.15.0
2025-12-17 15:17:39.776 DEBUG 79680 --- app: Use LOG_LEVEL=INFO to decrease verbosity. Supported values: DEBUG, INFO, WARN, ERROR
2025-12-17 15:17:39.776 DEBUG 79680 --- namespaced-logger: Doing something... {"foo":"bar"}
2025-12-17 15:17:39.776  INFO 79680 --- namespaced-logger: Hello world from namespaced Logger!
2025-12-17 15:17:39.776  WARN 79680 --- namespaced-logger: Something is not right...
2025-12-17 15:17:39.776 ERROR 79680 --- namespaced-logger: Something went wrong! Error: Oops!
    at <anonymous> (.../logger/src/hello.ts:10:39)
    at ModuleJob.run (node:internal/modules/esm/module_job:274:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)
2025-12-17 15:17:39.776  INFO 79680 --- namespaced-logger: Parameterized log level

Screenshot

API

type LogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';

interface Logger {
    debug: (...args: unknown[]) => void;
    info: (...args: unknown[]) => void;
    warn: (...args: unknown[]) => void;
    error: (...args: unknown[]) => void;
    log: (level: LogLevel, ...args: unknown[]) => void;
    level: LogLevel;
    name: string;
}

declare const logger: Logger;

/**
 * Get a logger instance with the specified name.
 * @param name Name of the logger.
 * @param logLevel Log level for the logger. Defaults to the global log level.
 */
export declare function getLogger(name: string, logLevel?: LogLevel): Logger;
export default logger;

History

  • 1.0.0 Initial release