Skip to content

Commit 4a10354

Browse files
committed
Add FAQ to readme
1 parent 77126fb commit 4a10354

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

readme.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515

1616
![](media/screenshot.png)
1717

18+
## Info
19+
20+
- [Why not switch to a smaller coloring package?](https://github.com/chalk/chalk?tab=readme-ov-file#why-not-switch-to-a-smaller-coloring-package)
21+
- See [yoctocolors](https://github.com/sindresorhus/yoctocolors) for a smaller alternative
22+
1823
## Highlights
1924

2025
- Expressive API
@@ -246,9 +251,25 @@ Since Chrome 69, ANSI escape codes are natively supported in the developer conso
246251

247252
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
248253

249-
## Origin story
254+
## FAQ
255+
256+
### Why not switch to a smaller coloring package?
257+
258+
Chalk may be larger, but there is a reason for that. It offers a more user-friendly API, well-documented types, supports millions of colors, and covers edge cases that smaller alternatives miss. Chalk is mature, reliable, and built to last.
259+
260+
But beyond the technical aspects, there's something more critical: trust and long-term maintenance. I have been active in open source for over a decade, and I'm committed to keeping Chalk maintained. Smaller packages might seem appealing now, but there's no guarantee they will be around for the long term, or that they won't become malicious over time.
261+
262+
Chalk is also likely already in your dependency tree (since 100K+ packages depend on it), so switching won’t save space—in fact, it might increase it. npm deduplicates dependencies, so multiple Chalk instances turn into one, but adding another package alongside it will increase your overall size.
263+
264+
If the goal is to clean up the ecosystem, switching away from Chalk won’t even make a dent. The real problem lies with packages that have very deep dependency trees (for example, those including a lot of polyfills). Chalk has no dependencies. It's better to focus on impactful changes rather than minor optimizations.
265+
266+
If absolute package size is important to you, I also maintain [yoctocolors](https://github.com/sindresorhus/yoctocolors), one of the smallest color packages out there.
267+
268+
*\- [Sindre](https://github.com/sindresorhus)*
269+
270+
### But the smaller coloring package has benchmarks showing it is faster
250271

251-
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
272+
[Micro-benchmarks are flawed](https://sindresorhus.com/blog/micro-benchmark-fallacy) because they measure performance in unrealistic, isolated scenarios, often giving a distorted view of real-world performance. Don't believe marketing fluff. All the coloring packages are more than fast enough.
252273

253274
## Related
254275

0 commit comments

Comments
 (0)