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

colorific

v0.2.0

Published

Text coloring (with ANSI) for nodejs

Readme

node-colorific

CI npm version license

Text coloring (with ANSI) for Node.js.

This package was heavily inspiried by Muslim Idris' node-curly-colors and several other ANSI/Color - specific packages available on the npm repository.

The reason - for me - to write yet another coloring package was that I personally don't like having any properties and/or functions attached to the String object and find it preferably to encode the colorinformation within the String itself. That leaves the possibility to save my messages in some JSON file and retrieve them later - making it easy to write internationalization functions. In addition I noticed that there are quite a couple of different format tags out there and people seem to like various different styles. So instead of inventing yet another fixed format library I tried to enable all kinds of custom format supporting - almost - every format that is currently already available.

Documentation

GitHub/npm only render this file by default, so here's everything else:

  • Quickstart - install it and color your first string in under a minute.
  • Tutorial - how tag formats, nesting, custom formats and printf/template-literal usage actually work.
  • Cheatsheet - every predefined tag format and every supported ANSI code, in table form.
  • Examples - copy-pasteable snippets, including the bundled color-table demo.
  • Contribution guide - local setup, project layout, and how to submit a change.
  • Changelog - notable changes per version.
  • License - MIT.

Requirements

Node.js >= 18.18 (tested on the active 18.x, 20.x, 22.x and 24.x release lines, see .github/workflows/ci.yml). The package ships both an ES Module (src/colorific.js) and a CommonJS build (src/colorific.cjs) and has zero runtime dependencies.

Installation

$ npm install --save colorific

$ yarn add colorific

See the Quickstart for how to use it right after installing.

Known quirks

  • Unknown/unrecognized @KEY values (anything not in the supported ANSI codes list in the Cheatsheet) are left completely untouched in the output, tag and all.
  • Compression removes redundant SGR codes. If the same code is opened twice with no other code in between (e.g. two adjacent @red: sections, or a reset that is immediately followed by another reset), the second, redundant escape sequence is dropped rather than emitted twice.
  • Closing tags that don't match the key of the currently open tag (e.g. <red>text</blue> when using the SGML format) are not recognized as a closing tag and are left in the output as literal text; the originally opened tag is still closed automatically at the end of the string.

See the Tutorial for the full explanation of why these happen.

Testing

npm test

Runs the Mocha/Chai suite in spec/, covering every predefined tag format, every supported ANSI code, custom tag formats, nesting/compression behaviour and the CommonJS/ESM entry points. See the Contribution guide for more.

Contributing

Issues and pull requests are welcome - see the Contribution guide for how to get set up, or jump straight to github.com/joetjen/node-colorific/issues.

License

MIT © 2013-2026 Jan Oetjen