
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@spacingbat3/kolor
Advanced tools
A simple Node.js module to add kolors to you console!
Kolor is a Polish word that means colour / color.
colors or modifiers[*]):import {colors, modifiers} from "@spacingbat3/kolor"
// Because errors should be red :)
console.error(colors.red("ERROR: Something went wrong!"))
// Modifiers are grouped by `safe` and `other`:
console.log(modifiers.safe.bold("Definitely important text."))
default object as colors that contains all method packed in one
object (except other modifiers, they're in unsafe object).import colors from "@spacingbat3/kolor"
// Now, syntax is similar to the one in `colors/safe` module.
console.warn(colors.bold("==> "+colors.brightYellow("Warning:"))+" Something happened!")
// Synchronously with `require` (CommonJS):
const { colors, modifiers } = require("@spacingbat3/kolor")
console.log(colors.purple("Colorized text goes here."));
// or, with "default" object
const colors_2 = require("@spacingbat3/kolor").default;
console.log(colors_2.purple("Colorized text goes here."));
// Async with `import` (ESM):
import("@spacingbat3/kolor")
.then(kolor => {
// Here, default, colors and modifiers objects are available.
const { colors, modifiers } = kolor;
console.debug(colors.gray(colors.bold("Debug")+": some information goes here!"));
})
.catch(e => console.error(e));
In general, I made this module as an answer to colors library sabotage. I
decided to neither thrust colors not any alternatives to it, when I only need
some of its features.
You can use this library as well in your project, this is why I publish it. You may ask: should I trust you? It depends on what you need – as ISC license says, this program has no guarantee it will work as expected, yet this software is developed in hope to be useful to anyone (like most OSS software should be developed). Also, I may not frequently improve it, I made it specifically for my personal needs, if you need something more complex just use another library.
Please note it's syntax is not fully compatible with colors, specifically it
is not touching the String.prototype. You may find it easier to move from
colors/safe, through. If you need a library that uses String.prototype to
easily switch from colors, this module is not for you, neither chalk is.
chalk or fork of colors?This project has a different philosophy that both of these projects. It's neither an ESM module nor has any rich features – it's much more simple, doing only some simple tests to detect if text should be colorized or not and being limited (at least for now) only to 16-bit color palete. It might be however much more performant, as it uses ES2021 features to be much shorter, simpler and not being bloated with unnecessary colors.
Another difference (at least from colors) is that kolor separates some
ANSI escape codes that are not working on all platforms, which you may find
useful if your application is meant to be cross-platform.
Since v3.2.0 it also provides the type definitions for transforming the
literal types, which makes TypeScript to accurately predict all combinations of
types for the library and overall improves the type accuracy (not just for
literals).
This project is licensed under the ISC license, which should be distributed
with this project. Not distributing it
with this library might be against the license – please read the license for
further information.
FAQs
A simple module to colorize your Node.js console.
We found that @spacingbat3/kolor 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.