# colors.js

> Colours and styles for Node.js console output (npm package colors)

Source: https://talira.ai/catalog/colors-js-e1vy93vd
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / terminal ui](https://talira.ai/categories/libraries/terminal-ui), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^5]
- Pricing: Free and open source[^4]
- Free tier: yes[^4]
- Backed by: [Marak Squires](https://talira.ai/orgs/marak-squires.md)

colors.js (the npm package colors) adds colour and style to text in the Node.js console: text colours, bright colours, background colours and styles such as bold and dim, plus effects such as rainbow. By default it extends String.prototype so you can write 'text'.red; require('colors/safe') leaves String alone. npm's latest version is still 1.4.0 from September 2019, and the repository's master branch carries code that loops forever when imported (see limitations). [Chalk](https://talira.ai/catalog/chalk-pf0cyh21.md) is an alternative.

## Links

- GitHub: https://github.com/Marak/colors.js

## Problems it solves

- print coloured text in a Node.js terminal app
- style console output with bold and background colours in JavaScript
- colour log messages in a Node.js CLI

## Features

- text, bright, background and bright background colours
- styles such as bold, dim, italic and underline
- rainbow and other text effects
- a safe mode that doesn't extend String.prototype
- custom themes

## Limitations

- The repository's master branch (version 1.4.44-liberty-2, January 2022) loops forever printing garbled text when imported, so don't install it from GitHub; npm serves 1.4.0.[^1][^2][^3]
- By default it extends String.prototype; use colors/safe to avoid that.[^1]
- npm's latest release, 1.4.0, dates from September 2019.[^3]

## Trust

Overall: 0.47 out of 1.
Signals: maintenance 0.46, adoption 0.74, momentum 0.43, community 0.68, backing 0.30, extensibility 0.00.

- last commit 39 days ago
- 2 commits in the last 90 days
- 5.2k GitHub stars
- 48 contributors
- backed by Marak Squires

## Alternatives

- [Chalk](https://talira.ai/catalog/chalk-pf0cyh21.md): Terminal string styling for Node.js: colours, backgrounds and text styles
- [strip-ansi](https://talira.ai/catalog/strip-ansi-rvjxg9c5.md): Strip ANSI escape codes from a string

## Sources

[^1]: https://github.com/Marak/colors.js/blob/master/lib/index.js (checked 28 Nov 2026)
[^2]: https://github.com/Marak/colors.js/blob/master/package.json (checked 28 Nov 2026)
[^3]: https://registry.npmjs.org/colors (checked 28 Nov 2026)
[^4]: https://github.com/Marak/colors.js/blob/master/README.md (checked 28 Nov 2026)
[^5]: https://github.com/Marak/colors.js/blob/master/LICENSE (checked 28 Nov 2026)
