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

chromark

v0.1.1

Published

Colorize and transform console output using §-based inline tags.

Readme

chromark

Colorize and transform console output using §-based inline tags.

Showcase

chromark showcase

Why

  • Inline styling: keep your messages readable while adding colors/transforms where needed.
  • No runtime lock-in: works with Bun and Node.
  • Composability: nest tokens and apply text transforms alongside visual styles.

Install

bun add chromark
# or
npm i chromark

Quick start

import { applyColors, c, enableAutoColors, disableAutoColors, color } from 'chromark'

console.log(applyColors('§green|upper:success§ §red:error§'))

enableAutoColors()
console.log('§blue|title:my title§ and §bgYellow|black:highlight§')
disableAutoColors()

console.log(c('§magenta|capitalize:custom helper§'))

console.log(color`Hello §yellow:world§!`)

Usage

ESM (Bun/Node)

import { applyColors } from 'chromark'
console.log(applyColors('§green:ok§'))

CommonJS (Node)

const { applyColors } = require('chromark')
console.log(applyColors('§green:ok§'))

Auto overrides

import { enableAutoColors, disableAutoColors } from 'chromark'
enableAutoColors({ console: true, stdout: true })
console.log('§yellow:highlight§')
disableAutoColors()

Nested styles and transforms

import { applyColors as a } from 'chromark'
console.log(a('§red:outer §green|underline:inner§ back§'))
console.log(a('§blue|title:my nice title§'))
console.log(a('§magenta|truncate=8:very long text here§'))

Syntax

  • Basic: §style:text§
  • Multiple styles: separate with |, e.g. §red|bold:text§
  • Nested: §red:outer §green|underline:inner§ outer§
  • Transforms: upper, lower, capitalize, title, camel, kebab, snake, reverse, repeat=3, pad=10 (optional filler: pad=10=_), truncate=8 (optional suffix: truncate=8=..)

API

  • applyColors(text): returns a new string with ANSI escapes applied.
  • c(text): alias for applyColors.
  • enableConsoleOverride() / disableConsoleOverride(): override console methods to auto-apply.
  • enableStdoutOverride() / disableStdoutOverride(): override process.stdout.write.
  • ColoredOutputStream: wrapper stream with write and log methods.
  • enableStringPrototypeExtension(): adds String#color().
  • color: template literal tag that applies colors to the resulting string.
  • enableAutoColors(options?): enable multiple overrides at once.

Run the examples

bun run example

Compatibility

  • Bun 1.0+ and Node 18+.
  • ESM and CJS builds are provided. Type definitions are referenced from index.ts.

Publishing & releases

  • Publishing is automated via GitHub Actions.
  • Create a git tag vX.Y.Z on main to trigger a release workflow.

Troubleshooting

  • If ANSI colors do not show, confirm your terminal supports ANSI and process.stdout.isTTY === true.
  • For Windows, modern terminals (Windows Terminal, VSCode) work best.

License

MIT © Daniel Lucas Silva