mrkeyoor.com_
Sat 08 Aug 21:59 UTC
npmCLI & Toolingupdated 08 Aug 2026

piccolore

Piccolore is a tiny, zero-dependency ESM library for adding ANSI colors and text styles to terminal output. It is a temporary fork of picocolors that keeps the same small functional API while targeting ESM and non-Node runtimes. You call helpers such as blue(), bold(), or bgRed() around text, or create an explicitly enabled or disabled color set. It covers the standard 16-color ANSI palette and common modifiers, not RGB colors, terminal layout, prompts, or log formatting.

Verdict

Piccolore is a clean, tiny option when ESM and non-Node portability are the exact requirements. Most Node projects should install picocolors instead because this package explicitly calls itself a temporary fork and remains pre-1.0.

API stability3/5The shipped surface is extremely small: one default color object, createColors(), a support boolean, and a fixed set of style functions. That simplicity limits accidental breakage, and there are no dependencies underneath it. Still, the current version is 0.1.3 and the repository explicitly labels the project a temporary fork, so consumers do not have a 1.0 compatibility promise or a stated long-term evolution policy.
Docs2/5The README accurately states the three defining traits and shows one nested-color example, but that is nearly the whole documentation set. It does not list the available style names, explain createColors(), document the environment and command-line detection rules, show CommonJS incompatibility, or describe behavior outside Node. Those facts are discoverable only by reading the compact shipped JavaScript and type declarations.
Maintenance3/5Version 0.1.3 and the repository's last push both landed on November 19, 2025, so this is not an abandoned package at the time of review. The repository has no open issues and the package has no runtime dependencies to patch. The caution is structural: it is presented as a temporary fork, has a very small public project footprint, and publishes no roadmap explaining when the fork ends or how long separate maintenance will continue.
Ecosystem3/5The registry recorded 3,663,983 downloads in the measured week, so the package clearly arrives in a meaningful number of dependency graphs. Its API closely follows picocolors, which reduces the conceptual migration cost. Direct community signals are much smaller: the repository has 3 stars, the README has one usage example, and there are no documented plugins or integrations. High download volume should not be mistaken for a broad standalone ecosystem.

Use it if

  • You publish an ESM-only command-line tool and want a terminal color dependency with no runtime dependencies
  • You need the picocolors-style function API in a runtime where importing Node built-ins is undesirable
  • You only need standard ANSI colors, bright variants, backgrounds, and basic text modifiers
  • You want to force color behavior explicitly in tests or a non-Node runtime with createColors(true) or createColors(false)
Skip it if

Setup reality

Installation is only npm install piccolore, with no peer or runtime dependencies and no native build. The important constraint appears at import time: the package is ESM-only, so require('piccolore') is not a supported entry path. The default export decides whether colors are enabled while the module initializes. It checks NO_COLOR, --no-color, FORCE_COLOR, --color, Windows, stdout.isTTY, TERM, and CI. Set environment variables or command flags before the process starts, not after importing the module. In browser, worker, and other non-Node runtimes, globalThis.process may be absent; the package still loads, but automatic detection generally resolves to no color. Use createColors(true) only when the output consumer understands ANSI escapes. There is no configuration file, color-level negotiation, RGB API, or chainable builder. Compose styles by nesting calls, and remember that disabled helpers still coerce values to strings. The implementation repairs nested occurrences of its own closing codes, which makes same-style nesting safe. Tests should normally use createColors(false) for stable plain-text snapshots or createColors(true) when asserting exact escape sequences. Because the README calls this a temporary fork and the API is still 0.x, pinning an exact version or choosing picocolors directly is sensible for a widely reused package.

Patterns

Color a line of terminal textcolor-basic-text

import pc from 'piccolore';

console.log(pc.blue('Build started'));

The default export enables or disables ANSI escapes from the process environment when the module loads.

Combine a color with bold textcombine-color-and-weight

import pc from 'piccolore';

console.log(pc.bold(pc.green('Build passed')));

Styles are functions, not chainable properties. Nest calls instead of writing pc.bold.green(...).

Give log levels consistent colorsformat-status-lines

import pc from 'piccolore';

const status = {
  info: (text) => pc.cyan(`info  ${text}`),
  warn: (text) => pc.yellow(`warn  ${text}`),
  error: (text) => pc.red(`error ${text}`),
};

console.log(status.warn('Cache is stale'));

Piccolore only styles strings; timestamps, prefixes, and log routing remain your application's responsibility.

Use foreground and background colorsstyle-background

import pc from 'piccolore';

const badge = pc.bgRed(pc.white(pc.bold(' FAILED ')));
console.error(badge);

Only fixed ANSI background colors and bright variants are available; there is no hex or RGB background helper.

Use bright ANSI variantsuse-bright-colors

import pc from 'piccolore';

console.log(pc.cyanBright('new release'));
console.log(pc.bgBlueBright(pc.black(' preview ')));

Old or limited terminals may render bright colors like their standard counterparts; the library does not negotiate color depth.

Force colors for a known ANSI consumerforce-colors

import { createColors } from 'piccolore';

const color = createColors(true);
const message = color.magenta(color.bold('always colored'));
process.stdout.write(message + '\n');

Forced output contains escape codes even when redirected to a file. Use it only when the destination supports ANSI.

Create a plain-text formatterdisable-colors

import { createColors } from 'piccolore';

const color = createColors(false);
console.log(color.red(color.bold('plain text'))); // plain text

Disabled functions still stringify their input, so the same formatting path can serve colored and plain output.

Keep test snapshots free of escape codessnapshot-output

import { createColors } from 'piccolore';
import { expect, test } from 'vitest';

const pc = createColors(false);

test('status message', () => {
  expect(pc.green(pc.bold('ok'))).toBe('ok');
});

An explicit disabled instance is more predictable than relying on whether the test runner happens to expose a TTY.

Branch on detected color supportcheck-color-support

import pc from 'piccolore';

if (pc.isColorSupported) {
  console.log(pc.green('Color is active'));
} else {
  console.log('Color is disabled');
}

Detection is a boolean, not a color-depth level; it does not distinguish 16-color, 256-color, and truecolor terminals.

Disable colors from the command linerespect-no-color

NO_COLOR=1 node ./cli.mjs
node ./cli.mjs --no-color

Both forms are read during module initialization. Setting process.env.NO_COLOR after importing piccolore is too late for the default export.

Request colors in redirected outputenable-color-flag

FORCE_COLOR=1 node ./cli.mjs
node ./cli.mjs --color

NO_COLOR and --no-color take precedence in the shipped detection expression, even when a force setting is also present.

Format numbers and booleansformat-non-string-values

import pc from 'piccolore';

console.log('count:', pc.yellow(42));
console.log('cached:', pc.cyan(false));
console.log('missing:', pc.dim(null));

The type declarations accept string, number, boolean, null, and undefined; all are converted with String semantics.

Alternatives

PackageRegistryPick it when
picocolorsnpmYou want the established upstream-style package and only need its tiny ANSI helper API
chalknpmYou want chainable styles, richer color levels, and a much larger documentation and user ecosystem
kleurnpmYou want a small, fast API with chainable color and modifier calls
colorettenpmYou want a compact zero-dependency color library with explicit color enablement controls