picocolors is billed as the tiniest and the fastest library for terminal output formatting with ANSI colors.
Picocolors provides an object which includes a variety of text coloring and formatting functions. The object includes following coloring functions: black, red, green, yellow, blue, magenta, cyan, white, and gray.
The object also includes following background color modifier functions: bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite and bright variants bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, and bgWhiteBright.
Besides colors, the object includes following formatting functions: dim, bold, hidden, italic, underline, strikethrough, reset, inverse and bright variants blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright.
This is free and open source software.
Key Features
- No dependencies.
- 14 times smaller and 2 times faster than chalk.
- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist.
- Node.js v6+ & browsers support. Support for both CJS and ESM projects.
- TypeScript type declarations included.
- NO_COLOR friendly.
- Additional utilities:
- isColorSupported – boolean, explicitly tells whether or not the colors or formatting appear on the screen.
- createColors(enabled) – function that returns a new API object with manually defined color support configuration.
Website: github.com/alexeyraspopov/picocolors
Support:
Developer: Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
License: ISC License
picocolors is written in JavaScript. Learn JavaScript with our recommended free books and free tutorials.
Related Software
| Terminal String Styling Tools | |
|---|---|
| Rich | Python library for rich text and beautiful formatting |
| Chalk | Bills itself as “Terminal string styling done right” |
| picocolors | Tiny and fast library for terminal output formatting |
| yoctocolors | Small and fast command-line coloring package |
| yachalk | Clone of Chalk written in Python |
| kleur | Node.js library for formatting terminal text with ANSI colors |
| colorette | Set your terminal text color and styles |
| sty | String styling for your terminal |
| termcolor | ANSI color formatting for output in the terminal |
| colored | Simple Python library for color and formatting in terminal |
| ansicolors | ANSI colors for Python |
| ansi-colors | Add ANSI colors to terminal text |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

