yoctocolors is a small, fast JavaScript command-line coloring package that applies ANSI color and style formatting in the terminal, including support for nested colors. It is useful for styling CLI output (text colors, background colors, and modifiers like bold or underline) and can detect whether colors are supported, with FORCE_COLOR and NO_COLOR options to override behavior.
Project status
- Likely in maintenance mode rather than actively maintained, since the most recent upstream update was on 2025-08-21 and there have been no updates since then as of 2026-06-09.
- Update cadence appears sporadic, with a cluster around 2025-08 (v2.1.1 to v2.1.3), then a long gap (next update listed is v2.1.1 on 2024-07-03).
AI summary generated
Recent updates
v2.1.3
This release switches the package implementation from an ESM re-export structure to a CommonJS module that directly exports a single colors object. The core ANSI formatting logic was also updated, including special handling for nested SGR sequences when the closing code is 22 (used by both bold and dim). No release notes were provided, so changes below are inferred from the code diff.
BreakingFeaturesv2.1.2
Release v2.1.2 primarily fixes incorrect ANSI styling output when dim (SGR 2) and bold (SGR 1) are nested, especially because SGR 22 resets both. The code change updates the nested-color formatting logic and adds extensive test coverage for additional nesting edge cases.
v2.1.1
v2.1.1 contains a targeted compatibility fix for Deno and a small documentation update. The code change makes the terminal color detection more defensive in runtimes where `node:tty` or its prototype methods are not available.
v2.1.0
This release refactors the package entry point to add a default export while keeping the existing named color exports. The implementation was moved from index.js into a new base.js module, and index.js now re-exports from it (including a default export namespace). Release notes only mention default import support.
Featuresv2.0.2
v2.0.2 makes a small internal change related to how nested ANSI color sequences are assembled. Release notes only mention removing some moot code, but the emitted escape sequence behavior for nested colors is different.
v2.0.1
v2.0.1 focuses on fixing how yoctocolors handles nested color functions. The implementation changes the core formatting logic to detect closing escape codes and correctly reapply the outer color, plus updates tests and documentation to cover nested coloring.
v2.0.0
This release of yoctocolors v2.0.0 adds a new set of bright foreground and bright background color formatters. It also raises the supported Node.js runtime to Node 18. The release notes cover these two items, but the code diff shows a few additional packaging and CI-related changes not mentioned.
BreakingFeaturesv1.0.0
This release primarily updates the package metadata and build/test configuration, and it is tagged as a breaking release. The main behavior-impacting change in the code diff is the Node.js support requirement in package.json.
Breakingv0.2.0
v0.2.0 introduces basic terminal color detection so yoctocolors only emits ANSI escape codes when the runtime indicates colors are supported. The README and test configuration were also updated to reflect this behavior.
BreakingFeaturesv0.1.1
Release v0.1.1 adds TypeScript type declarations for yoctocolors. The code diff also updates the test setup to validate the types with tsd, and makes a couple of README wording/content tweaks.
Featuresv0.1.0
Release v0.1.0 was published on 2021-10-01. The provided release notes contain no actionable information about features, fixes, breaking changes, or migration steps.