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

@gesslar/colours

v0.8.0

Published

256 colours for your terminal expressions. You're welcome.

Readme

@gesslar/colours

256 colours for your terminal expressions. Template literal-based ANSI colour library with precise colour selection, granular styles, and semantic aliases.

Installation

npm install @gesslar/colours

Quick Start

import c from '@gesslar/colours'

console.log(c`{F045}Running:{/} {F213}${testName}{/}`)
console.log(c`{F034}[OK]{/} Build completed {F240}(${time}ms){/}`)
console.log(c`{F196}[ERR]{/} {<B}Error:{/} ${message}`)

Core Features

256 Colour Palette

Use any colour from the 256-colour terminal palette:

// Foreground colours
c`{F045}Bright green text{/}`
c`{F196}Red text{/}`
c`{F033}Blue text{/}`

// Background colours
c`{B196}Red background{/}`
c`{B045}Green background{/}`

// Combined
c`{F255}{B196}White text on red background{/}`

Granular Style Control

Turn styles on and off individually:

// Turn on styles
c`{<BU}Bold and underlined{/}`
c`{<I}Italic text{/}`
c`{<S}Strikethrough{/}`

// Turn off specific styles
c`{<BIU}All three{B>}italic and underlined{I>}just underlined{/}`

// Available styles:
// - B(old)
// - D(im)
// - F(lash)
// - I(talic)
// - O(verline)
// - R(everse),
// - S(trikethrough)
// - U(nderline)

Semantic Aliases

Create meaningful names for your colours:

// Set up aliases
c.alias.set("success", "{F034}")
c.alias.set("error", "{F196}")
c.alias.set("warning", "{F214}")
c.alias.set("muted", "{F240}")

// Use them in your code
console.log(c`{success}[OK]{/} Operation completed`)
console.log(c`{error}[ERR]{/} Something went wrong`)
console.log(c`{warning}!{/} Check this out {muted}(optional){/}`)

// Complex aliases with styles
c.alias.set("header", "{F045}{<BU}")
console.log(c`{header}IMPORTANT SECTION{/}`)

Advanced Usage

CLI Tool Styling

import c from '@gesslar/colours'

// Status messages
const success = (msg) => console.log(c`{F034}[OK]{/} ${msg}`)
const error = (msg) => console.log(c`{F196}[ERR]{/} ${msg}`)
const info = (msg) => console.log(c`{F045}[INFO]{/} ${msg}`)

success("Build completed successfully")
error("Failed to load configuration")
info(`Processing ${count} files...`)

Test Output Enhancement

// Before: boring
console.log(`Running: ${testName}`)
console.log(`[OK] ${testName} passed (${time}ms)`)

// After: beautiful
console.log(c`{F045}Running:{/} {F213}${testName}{/}`)
console.log(c`{F034}[OK]{/} {F085}${testName}{/} passed {F240}(${time}ms){/}`)

Debug Levels

const debug = {
  error: (msg) => console.log(c`{F196}{<B}[ERROR]{/} ${msg}`),
  warn: (msg) => console.log(c`{F214}[WARN]{/} ${msg}`),
  info: (msg) => console.log(c`{F045}[INFO]{/} ${msg}`),
  debug: (msg) => console.log(c`{F240}[DEBUG]{/} ${msg}`)
}

Syntax Reference

Colour Codes

  • {F###} - Foreground colour (0-255)
  • {B###} - Background colour (0-255)
  • {/} - Reset all formatting

Style Codes

  • {<STYLES} - Turn on styles (e.g., {<BU} for bold+underline)
  • {STYLES>} - Turn off styles (e.g., {B>} to turn off bold)

Style Letters

  • B - Bold/Bright
  • D - Dim
  • F - Flash/Blink
  • I - Italic
  • O - Overline
  • R - Reverse
  • S - Strikethrough
  • U - Underline

Aliases

  • {aliasName} - Any alias you've created
  • Built-in: none (you define what you need)

Colour Selection Workflow

  1. Run colours command to see the colour chart (if CLI installed)
  2. Pick the colour number you want
  3. Use it in your code: c`{F045}text{/}

API Reference

Main Function

  • c`template - Process template literal with colour codes

Alias Management

  • c.alias.set(name, replacement) - Create an alias
  • c.alias.del(name) - Remove an alias

Why @gesslar/colours?

vs ansi-colours:

  • Precise colour selection with visual picker
  • Cleaner syntax: c`{F045}text{/} vs ansiColors.rgb(255,100,50)('text')
  • No guessing what .yellowBright actually looks like
  • Granular style control

vs chalk:

  • 256-colour palette support
  • Template literal syntax
  • Semantic aliases you define
  • Lighter weight, focused scope

License

The Unlicense, because colours belong to everybody and if you disagree, well, you probably would download a car. 🤨


"I want green here, but which green?" -> colours -> "oooo ok that one"

The workflow that just works.