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

logtint

v0.2.3

Published

Lightweight, isomorphic library that brings colors and style to your `console.log`

Readme

license npm version TypeScript bundle size

Table of Contents

Overview

Why LogTint?

Tired of digging through walls of gray text? Logging doesn’t have to be a snoozefest.
Whether you're squashing bugs, keeping an eye on things, or just want your console to look a bit fancier, logtint will help you highlight the important stuff — with style, consistency, and no fuss.

You know what's best of all?
It works seamlessly in Node.js and the browser.

Key Features

Getting started

logtint lets you add color and style to your logs with a single, easy-to-use API. It works in both Node.js and the browser, handling the messy stuff behind the scenes — ANSI codes for terminals, CSS for browsers. You just write your log once, and it figures out the rest.

How to install

npm install logtint

How to use

You wrap the parts of the message with utilities like bold, cyan, or any other to apply styling. Once you have your message ready, you need it to pass it through log function to make the styling work.

import log, { underline, bold } from "logtint"

log`By default, your messages are output through ${underline`console.log.`}.`
log(console.info)`But do you know you can output your messages through ${bold`any`} function?`
log(console.error)`You just need to pass a function that takes the message as its first argument!`

[!TIP]
Most logtint utilities can be used as both functions and template literals
Use the syntax that fits best for your use case — they’re interchangeable!

Want to turn a color into a background? Just wrap it with bg(...).
Need a brighter version of a color? Make it brighter with bright(...).

And yes — you can mix them!

import log, { bright, bg, yellow } from "logtint"

log(bg(yellow)`You can make any color a background color!`)
log(bright(yellow)`Or maybe you just need a brighter color?`)
log(bright(bg(yellow))(yellow`Yellow text on a bright yellow background? Just use both!`))

Use tint whenever you must keep your tinted reusable bits for later!

import log, { tint, italic, bg, blue } from "logtint"

const message = tint`A ${italic`reusable`} message.`
const logger = (level, message) =>
    tint`[${level}] ${message}`
const debug = bg(blue)`DEBUG`

// Hijack your console.log 
console.log = (message) => {
    log(console.log)`${logger(debug, message)}`
}

console.log(message)

A lot of crayons to choose from!
All tree-shakeable to keep your bundles lean and mean.

import {
    // Crayons for text formatting
    bold, italic, underline, strikethrough, dim, inverse, hidden,
    // Crayons for coloring
    black, white, red, green, blue, yellow, magenta, cyan,
    // Crayon modifiers
    bg, bright
} from "logtint"

Compose and reuse!

import log, { bright, magenta, bold, italic, underline } from "logtint"

const highlight = bright(magenta)
const format = (text) => highlight(bold(italic(underline(text))))

log`You can compose them and combine them into a ${format("single crayon combo")}.`

Or make your own!

import log, { crayon, TextStyle } from "logtint"

const overline = crayon(TintStyle.from("text-decoration: overline;", 9 /* underline */))

log`You need your own? ${overline("We've got you covered!")}`