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

@akhilx/flog

v1.0.3

Published

A minimal and extensible ANSI-based logger with style and template support.

Readme

flog — Minimal and Styled Console Logger ✨

flog is a lightweight, zero-dependency console logger that lets you style terminal output using ANSI codes with ease. Think of it as a minimalist alternative to chalk, but with smart helpers and presets.


✨ Features

  • 🔹 Premade shortcuts: flog.success(), flog.info(), flog.warn(), flog.error()
  • 🎨 Custom styles: Use flog.style() to apply multiple ANSI styles, foregrounds, backgrounds
  • 🟦 Supports: hex, bgHex, rgb, bgRgb for true color output
  • 🧩 Presets: Create reusable styles with flog.addPreset('name', 'style')
  • ⚙️ Smart Loading: Visualize promise waiting using flog.loader().
  • 🪶 Zero dependencies & Lightweight

📦 Installation

npm install @akhilx/flog

🚀 Quick Start

import flog from '@akhilx/flog';

// Built-in styles
flog('This is a simple text!')
flog.info('Fetching data from API...');
flog.success('Successfully fetched!');
flog.warn('Data fetched is in wrong format!');
flog.error('Failed to Fetch Data!');

Built-In Style Demo

If you're using CommonJS:

const flog = require('@akhilx/flog').default;

💫 Promise Spinners and Loaders

//Use Spinners to wait for single promise
flog.loader(fetch('api.example.com'),'Waiting for response.');
flog.loader(fetch('api.example.com'), 'Waiting for response', 'Response Received', 'Request Failed'); //Custom success and fail messages.
// ⚠️ Do not use await while passing promise to loader function. flog.loader(await fetch...) ❌

//Using multiple promises for Percentage Animation
const responses = await flog.loader([
    fetch('api.example.com'),
    fetch('api.example2.com'),
    updateDb(data),
    //Other operations
], 'Updating Data...');
console.log('Responses:', responses);

Loader


🎨 Advanced Usage with flog.style(...)

Apply one or more styles using keywords:

flog.style('red underline', 'Styled message');
flog.style('bgBlue bold', 'Important alert');
flog.style('blue bgYellow italic', 'Color combo!');

Styles

✅ Supported styles (partial)

| Category | Examples | | ----------------- | ------------------------------------------------ | | Text Styles | bold, dim, italic, underline, blinking | | Foreground Colors | red, blue, green, yellow, etc. | | Background Colors | bgRed, bgBlue, bgWhite, etc. |


🎨 Hex & RGB Support

Use full 24-bit color via hex, bgHex, rgb, bgRgb syntax:

flog.style('hex-[#ff6347]', 'Tomato Red Text');
flog.style('bgHex-[#1e90ff]', 'Dodger Blue BG');

flog.style('rgb-[220, 20, 60]', 'I like Crimson');
flog.style('bgRgb-[66,245,161]', 'What is this color?');

Syntax:

  • hex-[#<hexcode>] → foreground
  • bgHex-[#<hexcode>] → background
  • rgb-[r,g,b] → foreground
  • bgRgb-[r,g,b] → background

📦 Add Custom Presets

Define your own style shortcuts:

flog.addPreset('danger', 'red bold underline');
flog.danger('This is dangerous!');

⚙️ Icon Toggle

Icons (✅, ℹ️, ⚠️, ❌) are shown by default in the built-in functions. You can disable them if needed:

flog.disableIcons();
flog.success('Icons are now hidden');

flog.enableIcons();
flog.success('Icons are back!');

📚 API Reference

| Method | Description | | ------------------------------ | ----------------------- | | flog(...args) | Plain logger (no style) | | flog.success(...args) | Green ✅ message | | flog.info(...args) | Blue ℹ️ message | | flog.warn(...args) | Yellow ⚠️ message | | flog.logger(Promise \| Promises[], msg...) | Promise Spinner or loaders | | flog.error(...args) | Red ❌ message | | flog.style(styles, ...args) | Apply multiple styles | | flog.addPreset(name, styles) | Add custom logger | | flog.disableIcons() | Turn off emojis | | flog.enableIcons() | Re-enable emojis |


📄 License

MIT © Akhil


🌟 Star & Help building this repo

If you find this useful, please ⭐️ the repo: https://github.com/AkhilTrivediX/flog