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

@dolgikh-maks/logger

v1.0.2

Published

A simple, cross-platform logger with support for debug, info, warning, success, error messages, and Promise loading indicators. Works in both Node.js and browser environments

Readme

Logger

A simple, cross-platform logger with support for debug, info, warning, success, error messages, and Promise loading indicators. Works in both Node.js and browser environments.


Installation

# Using npm
npm install @dolgikh-maks/logger

# Using yarn
yarn add @dolgikh-maks/logger

Philosophy of the instrument

When creating @dolgikh-maks/logger, I was guided by the principles:

  • Minimalism: No configurations longer than 100 lines
  • Predictability: Consistent behavior everywhere
  • Performance: Zero overhead when debug is off
  • Developer Experience: Easy-to-read logs = faster problem detection

Key advantages

  1. Context isolation. Each module has its own scope, which eliminates confusion when components are running in parallel.
  2. Visual hierarchy. Colored indicators (🔵 info, 🟢 success, 🟡 warning, 🔴 error) allow you to instantly assess the situation.
  3. Flexible debugging. The setDebug() flag enables detailed logs only when needed, without cluttering production.
  4. Timers out of the box. The loading() method automatically measures the execution time of asynchronous operations, which is critical for optimization.
  5. Cross-platform compatibility. A unified API for browsers and Node.js. The terminal even has an animated spinner for long operations.

Usage

Importing

import createLogger from '@dolgikh-maks/logger';

const logger = createLogger({ scope: 'MyApp' });
  • scope — a string to prefix all logs. Helps identify the module or feature producing the logs.

Methods

setDebug(enabled: boolean)

Enables or disables debug messages.

logger.setDebug(true);
logger.setDebug(false);

Example Output:

🔵 [MyApp]: Debug is enabled
🔵 [MyApp]: Debug is disabled

debug(message: string, ...args: any[])

Logs a debug message only if debugging is enabled.

logger.setDebug(true);
logger.debug('This is a debug message');

Example Output:

⚪ [MyApp]: This is a debug message

info(message: string, ...args: any[])

Logs an informative message.

logger.info('Application started');

Example Output:

🔵 [MyApp]: Application started

success(message: string, ...args: any[])

Logs a success message.

logger.success('Data loaded successfully');

Example Output:

🟢 [MyApp]: Data loaded successfully

warn(message: string, ...args: any[])

Logs a warning message.

logger.warn('Deprecated API usage');

Example Output:

🟡 [MyApp]: Deprecated API usage

error(message: string, ...args: any[])

Logs an error message.

logger.error('Failed to fetch data');

Example Output:

🔴 [MyApp]: Failed to fetch data

loading<T>(comment: string, promise: Promise<T>): Promise<T>

Shows a loading indicator while a Promise is pending. Automatically logs success or failure when the promise resolves or rejects. Works differently in Node.js and browser environments:

  • Browser — simple console.log with timing.
  • Node.js — animated spinner in terminal if TTY is available.
const fetchData = new Promise((resolve) => setTimeout(() => resolve('Done'), 1000));

logger.loading('Fetching data', fetchData).then(result => {
  console.log(`Result: ${result}`);
});

Example Output (Browser):

🟢 [MyApp]: Fetching data (1002ms)
Result: Done

Example Output (Node.js):

🔄 [MyApp]🐳
🔄 [MyApp]  🐳
🔄 [MyApp]    🐳
🔄 [MyApp]      🐳
🟢 [MyApp]: Fetching data
Result: Done

Example Combined Usage

const logger = createLogger({ scope: 'App' });

logger.setDebug(true);
logger.info('Starting application...');
logger.debug('Debugging mode is on');

const asyncTask = new Promise((resolve) => setTimeout(resolve, 2000));
await logger.loading('Performing async task', asyncTask);

logger.success('Application finished');

Output (Node.js):

🔵 [App]: Starting application...
⚪ [App]: Debugging mode is on
🔄 [App] 🐳
🔄 [App]   🐳
🟢 [App]: Performing async task
🟢 [App]: Application finished