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

@kytta/colours

v1.0.0

Published

The second-fastest command-line colouring package on the internet

Readme

colours

The fastest command-line colouring package on the internet

Check out the alternatives for more packages like this.

Highlights

  • Tiny
  • Fast
  • Tree-shakeable
  • No dependencies
  • Actively maintained
  • Supports NO_COLOR & FORCE_COLOR
  • Supports bright colours
  • Can be composed (WIP)
  • Works in browsers
  • Works on CommonJS

Install

pnpm add @kytta/colours

Usage

import * as colours from "@kytta/colours";

console.log(colours.red("Yo!"));

This package supports basic color detection. Colors can be forcefully enabled by setting the FORCE_COLOR environment variable to 1 and can be forcefully disabled by setting NO_COLOR or NODE_DISABLE_COLORS to any value. More info.

Styles

Modifiers

  • reset - Reset the current style.
  • bold - Make the text bold.
  • dim - Make the text have lower opacity.
  • italic - Make the text italic. (Not widely supported)
  • underline - Put a horizontal line below the text. (Not widely supported)
  • overline - Put a horizontal line above the text. (Not widely supported)
  • inverse- Invert background and foreground colors.
  • hidden - Print the text but make it invisible.
  • strikethrough - Puts a horizontal line through the center of the text. (Not widely supported)

Colors

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • blackBright (alias: gray, grey)
  • redBright
  • greenBright
  • yellowBright
  • blueBright
  • magentaBright
  • cyanBright
  • whiteBright

Background colors

  • bgBlack
  • bgRed
  • bgGreen
  • bgYellow
  • bgBlue
  • bgMagenta
  • bgCyan
  • bgWhite
  • bgBlackBright (alias: bgGray, bgGrey)
  • bgRedBright
  • bgGreenBright
  • bgYellowBright
  • bgBlueBright
  • bgMagentaBright
  • bgCyanBright
  • bgWhiteBright

Prior art

Yes:

  • yoctocolors by Sindre Sorhus. This is a fork of it.
  • picocolors by Alexey Raspopov. As small as it can get.
  • nanocolors by Andrey Sitnik. A fork of colorette with hacks from kleur/colors.
  • colorette by Jorge Bucaran. The OG lightweight command-line colouring library.
  • kleur by Luke Edwards. Supports nesting and chaining
  • chalk by Sindre Sorhus. The most advanced of the bunch. Supports all RGB colours with graceful degradation, and more.
  • ansi-colors by Brian Woodward. A (then) faster drop-in replacement for Chalk without the bugs of other libraries.
  • cli-color by Mariusz Nowak. Supports 256 colours with some nice features added on top.

What should I use?

Probably chalk. But maybe not! See this graph for help:

A flowchart diagram illustrating your intended choice process. Choose this package, if you value speed and package size, if you don't need that many features, or if you want browser interoperability. If you need support for CommonJS and/or Node 10, and if you are willing to sacrifice functionality, choose this package also. Otherwise, choose Chalk v4 or v5, depending on the support for CommonJS.

Benchmark

This is outdated.

$ ./benchmark/index.js
┌─────────┬──────────────────┬──────────────┐
│ (index) │     Library      │   ops/sec    │
├─────────┼──────────────────┼──────────────┤
│    0    │ '@kytta/colours' │ '27.725.838' │
│    1    │  'yoctocolors'   │ '26.188.058' │
│    2    │   'nanocolors'   │ '17.240.092' │
│    3    │   'picocolors'   │ '16.857.757' │
│    4    │   'colorette'    │ '16.798.142' │
│    5    │  'kleur/colors'  │ '16.535.599' │
│    6    │     'kleur'      │ '10.393.367' │
│    7    │    'chalk@5'     │ '10.101.294' │
│    8    │    'chalk@4'     │ '9.207.347'  │
│    9    │  'ansi-colors'   │ '3.825.073'  │
│   10    │   'cli-color'    │  '806.073'   │
└─────────┴──────────────────┴──────────────┘

See benchmark/index.js.

License

© 2023 Nikita Karamov
Licensed under the MIT License.

Based on yoctocolors.
© Sindre Sorhus
Licensed under the MIT License.


This project is hosted on GitHub: https://github.com/kytta/colours.git