HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Marak
colors.js
JavaScript2010–2022
Marak / colors.js

colors.js

get colors in your node.js console

16Distinct people
20Mentions
0Explicit recommenders
5.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

get colors in your node.js console

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year20 dated mentions

Observed mentions: 2010-06-11 12:18:38 UTC to 2022-11-22 01:05:21 UTC.

051015202010-01-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20102011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 19 mentions; 8 submissions, 11 comments2022

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20102010-01-01 00:00:00 UTC2011-01-01 00:00:00 UTC110
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC000
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC000
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC000
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC000
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC19811

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
colors.js Please check out the roadmap for upcoming features and releases. Please open Issues to provide feedback, and check the develop branch for the latest bleeding-edge updates. get color and style in your node.js console Installation npm install colors colors and styles! text colors black red green yellow blue magenta cyan white gray grey bright text colors brightRed brightGreen brightYellow brightBlue brightMagenta brightCyan brightWhite background colors bgBlack bgRed bgGreen bgYellow bgBlue bgMagenta bgCyan bgWhite bgGray bgGrey bright background colors bgBrightRed bgBrightGreen bgBrightYellow bgBrightBlue bgBrightMagenta bgBrightCyan bgBrightWhite styles reset bold dim italic underline inverse hidden strikethrough extras rainbow zebra america trap random Usage By popular demand, colors now ships with two types of usages! The super nifty way var colors = require('colors'); console.log('hello'.green); // outputs green text console.log('i like cake and pies'.underline.red); // outputs red underlined text console.log('inverse the color'.inverse); // inverses the color console.log('OMG Rainbows!'.rainbow); // rainbow console.log('Run the trap'.trap); // Drops the bass or a slightly less nifty way which doesn't extend String.prototype var colors = require('colors/safe'); console.log(colors.green('hello')); // outputs green text console.log(colors.red.underline('i like cake and pies')); // outputs red underlined text console.log(colors.inverse('inverse the color')); // inverses the color console.log(colors.rainbow('OMG Rainbows!')); // rainbow console.log(colors.trap('Run the trap')); // Drops the bass I prefer the first way. Some people seem to be afraid of extending String.prototype and prefer the second way. If you are writing good code you will never have an issue with the first approach. If you really don't want to touch String.prototype, the second usage will not touch String native object. Enabling/Disabling Colors The package will auto-detect whether your terminal can use colors and enable/disable accordingly. When colors are disabled, the color functions do nothing. You can override this with a command-line flag: node myapp.js --no-color node myapp.js --color=false node myapp.js --color node myapp.js --color=true node myapp.js --color=always FORCE_COLOR=1 node myapp.js Or in code: var colors = require('colors'); colors.enable(); colors.disable(); Console.log string substitution var name = 'Marak'; console.log(colors.green('Hello %s'), name); // outputs -> 'Hello Marak' Custom themes Using standard API var colors = require('colors'); colors.setTheme({ silly: 'rainbow', input: 'grey', verbose: 'cyan', prompt: 'grey', info: 'green', data: 'grey', help: 'cyan', warn: 'yellow', debug: 'blue', error: 'red' }); // outputs red text console.log("this is an error".error); // outputs yellow text console.log("this is a warning".warn); Using string safe API var colors = require('colors/safe'); // set single property var error = colors.red; error('this is red'); // set theme colors.setTheme({ silly: 'rainbow', input: 'grey', verbose: 'cyan', prompt: 'grey', info: 'green', data: 'grey', help: 'cyan', warn: 'yellow', debug: 'blue', error: 'red' }); // outputs red text console.log(colors.error("this is an error")); // outputs yellow text console.log(colors.warn("this is a warning")); Combining Colors var colors = require('colors'); colors.setTheme({ custom: ['red', 'underline'] }); console.log('test'.custom); Protip: There is a secret undocumented style in colors. If you find the style you can summon him.
Read the full README on GitHub

What Hacker News says

20 sources
> A new feature was added to the colors.js project for generating cool ASCII Art American Flags. Unfortunately, this feature was not bug-free and some test code slipped into the release causing issues downstream. Nobody is perfect. Everyone makes mistakes from time to time. https://github.com/Marak/colors.js/commits/master shows 4 commits and 2 releases. Does not seem like a simple mistake > As per our internal open-source development process, I opened an Issue in colors to track the bug as soon as it was confirmed. It happened to be a weekend [...] I tagged some other open-source developers I've worked with in the past to see if they had time to assist and closed the browser tab. https://github.com/Marak/colors.js/issues/285 issue in question: https://github.com/Marak/colors.js/issues/285 11:26pm issue opened 2:24am someone identifies t
Read the rest
he fix, but marak comments: "Still trying to figure out what happened. I think we may have tried to upgrade to JavaScript 6 but the CI system only supports JavaScript 5 and lower." 11:33am marak comments: "We've been up all night trying to work out a solution for this Zalgo bug and are still coming up short." This post is cringeworthy to read... does Marak thinks not one remembers what happened?
In Marak: The reports of my death have been greatly exaggerated
> LOL, you forked many repositories and didn't push any code. Well, firstly that isn't true, and secondly even if it were true it's a good idea to fork repos you use. So, not only are you: - childish ("LOL", really? This is HN) - lying (always the sign of a strong argument) - unable to search Github effectively You also show bad development practices. Did you not see what happened this week with Colors.js[1]? > You just proved my point. Quite the opposite. > Just people without experience in Crystal comes to ruby related threads to say "Dude, use Crystal". Where is your repo showing your experience in Crystal? Or Ruby for that matter. Money where mouth is time, do you even have a single commit to a project in either language? [1] https://github.com/Marak/colors.js/commit/074a0f8ed0c31c35d1...
In An Ode to Ruby
> https://github.com/Marak/colors.js/blob/5152d16f22789d66e107... So can you point me to where this license says you cannot modify this code? Or that by accepting distribution of one version of this code, you are obligated to distribute future versions? You can't hide behind "The license doesn't say he has to play nice, so you can't complain about him not playing nice", then say it's unfair that npm don't go behind their license and TOS obligations to host his spite version.
In What NPM should do to stop a new colors attack
> And in a non-commercial setting his changes aren't even close to being deemed harmful So you don't even know what happened? There's an infinite loop after it finishes printing garbage. It's an unquestionably harmful change. Also, you know how you prevent non-commercial use? https://github.com/Marak/colors.js/blob/master/LICENSE - I don't get it, Marak is clearly having some sort of episode*, and people are bending over backwards to rationalize the result as if there's some clear connection between his intent and his actions. How many people realize he made those anti-commercial comments two years ago. Right now it actually seems like his comments were more political than financial. * I don't mean that in a backhanded way, based on his history and his recent comments I think this is someone who needs help regardless of his actions on NPM
Read the rest
*
In What NPM should do to stop a new colors attack
But with contributors, it's literally not his to "own", in terms of the actual work. Copyright law says roughly that you own the characters you type, unless you assign it to someone else. The guy who actually wrote more of colors.js (by lines of code) than marak actually got npm to nuke the offending releases: https://github.com/Marak/colors.js/issues/317 right now they are reviewing a request to change the npm target to his repo
In What NPM should do to stop a new colors attack
Did he own this code? Colors.js had plenty of other contributors, and there was no CLA involved. github user "DABH" actually had more lines of code than marak did: https://github.com/Marak/colors.js/graphs/contributors npm and github both have terms of service that you agree to when you choose to distribute something over those systems. npm in particular has had a long policy of unrolling malicious changes to the registry of packages ever since left-pad.
In What NPM should do to stop a new colors attack
You don't get to have it both ways: If you go by the spirit of things tanking a package and Github/MS/npm taking over to undo that is fair game. Even if it's not literally a virus, obviously damaging basic functionality to make a statement is not a sustainable practice for NPM to continue functioning If you want to go by the letter and what legal rights someone has: https://docs.npmjs.com/policies/conduct > The Service administrators reserve the right to make judgment calls about what is and isn't appropriate in published packages, package names, user and organization names, and other public content. Package that violates the npm Service's Acceptable Use rules including its Acceptable Content rules will be deleted, at the discretion of npm. https://docs.npmjs.com/policies/open-source-terms > Your Content belongs to you. You decide whether
Read the rest
and how to license it. But at a minimum, you license npm to provide Your Content to users of npm Services when you share Your Content. That special license allows npm to copy, publish, and analyze Your Content, and to share its analyses with others. npm may run computer code in Your Content to analyze it, but npm's special license alone does not give npm the right to run code for its functionality in npm products or services. > When Your Content is removed from npm Services, whether by you or npm, npm's special license ends when the last copy disappears from npm's backups, caches, and other systems. *Other licenses, such as open source licenses, may continue after Your Content is removed. Those licenses may give others, or npm itself, the right to share Your Content with npm Services again.* https://github.com/Marak/colors.js/blob/master/LICENSE - Seriously, why are people so adamant about defending this? We're all part of a giant ecosystem that relies on everyone being "a freeloading dick" in your eyes. Colors wouldn't have its audience without its creator being a "freeloading dick" and expecting NPM to serve it millions of times for free. NPM relies on a JS ecosystem propped up by "freeloading dicks". "Freeloading dick" is such a dumb characterization of what it really is: Expecting FOSS creators and maintainers to be somewhat cognizant of the ecosystem past the tip of their nose.
In What NPM should do to stop a new colors attack

Showing the 15 most recent of 20 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.