
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
Easily set your terminal text color & styles.
NO_COLOR friendly10import { blue, bold, underline } from "colorette"
console.log(
blue("I'm blue"),
bold(blue("da ba dee")),
underline(bold(blue("da ba daa")))
)
Here's an example using template literals.
console.log(`
There's a ${underline(blue("house"))},
With a ${bold(blue("window"))},
And a ${blue("corvette")}
And everything is blue
`)
You can also nest styles without breaking existing color sequences.
console.log(bold(`I'm ${blue(`da ba ${underline("dee")} da ba`)} daa`))
Need to override terminal color detection? You can do that too.
import { createColors } from "colorette"
const { blue } = createColors({ useColor: false })
console.log(blue("Blue? Nope, nah"))
npm install colorette
See all supported colors.
import { blue } from "colorette"
blue("I'm blue") //=> \x1b[34mI'm blue\x1b[39m
Override terminal color detection via createColors({ useColor }).
import { createColors } from "colorette"
const { blue } = createColors({ useColor: false })
true if your terminal supports color, false otherwise. Used internally, but exposed for convenience.
You can override color detection from the CLI by setting the --no-color or --color flags.
$ ./example.js --no-color | ./consumer.js
Or if you can't use CLI flags, by setting the NO_COLOR= or FORCE_COLOR= environment variables.
$ NO_COLOR= ./example.js | ./consumer.js
| Colors | Background Colors | Bright Colors | Bright Background Colors | Modifiers |
|---|---|---|---|---|
| black | bgBlack | blackBright | bgBlackBright | dim |
| red | bgRed | redBright | bgRedBright | bold |
| green | bgGreen | greenBright | bgGreenBright | hidden |
| yellow | bgYellow | yellowBright | bgYellowBright | italic |
| blue | bgBlue | blueBright | bgBlueBright | underline |
| magenta | bgMagenta | magentaBright | bgMagentaBright | |
| cyan | bgCyan | cyanBright | bgCyanBright | reset |
| white | bgWhite | whiteBright | bgWhiteBright | |
| gray |
npm --prefix bench start
chalk 1,786,703 ops/sec
kleur 1,618,960 ops/sec
colors 646,823 ops/sec
ansi-colors 786,149 ops/sec
picocolors 2,871,758 ops/sec
+ colorette 3,002,751 ops/sec
Colorette started out in 2015 by @jorgebucaran as a lightweight alternative to Chalk and was introduced originally as Clor. Our terminal color detection logic borrows heavily from @sindresorhus and @Qix- work on Chalk. The idea of slicing strings to clear bleeding sequences was adapted from a similar technique used by @alexeyraspopov in picocolors. Thank you to all our contributors! <3
Chalk is a popular npm package similar to colorette that allows for styling and coloring terminal text. It offers a chainable API and additional color options. Chalk is known for its ease of use and extensive customization capabilities, but it might be slightly larger in size compared to colorette.
Ansi-colors is another npm package for coloring terminal text. It focuses on performance and is dependency-free. It provides a similar API to colorette but with a different implementation approach. Ansi-colors may offer better performance in certain scenarios.
Kleur is a lightweight alternative to colorette with zero dependencies. It offers a similar API for text coloring and formatting. Kleur is designed for performance and has a minimalistic approach, which might make it faster in some cases.
FAQs
🌈Easily set your terminal text color & styles.
The npm package colorette receives a total of 57,229,676 weekly downloads. As such, colorette popularity was classified as popular.
We found that colorette demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.