Provides ANSI escape codes and style helpers for coloring and formatting strings in terminals. Useful if you want to apply styles like modifiers (for example bold or underline) and colors, and optionally convert colors between 16, 256, and truecolor formats for console output.
Project status
- Actively maintained: The most recent recorded upstream push is 2026-02-27, and the most recent listed package update is v6.2.3 (2025-09-08), indicating ongoing work rather than dormancy.
- Update cadence: Based on the evidence, updates appear sporadic (multi-year gaps earlier), but there has been activity within the last year (v6.2.3 in 2025, upstream push in early 2026).
AI summary generated
Recent updates
v6.2.3
Release v6.2.3 is primarily described as a security fix related to v6.2.2. The actual diff shows small runtime syntax tweaks and, more notably, changes to the exported TypeScript declaration shapes (interfaces converted to type aliases), plus updates to CI Node versions and dev tooling.
Securityv6.2.1
This release (v6.2.1) addresses an issue related to the exported lists of style names from the package. The published change is small and localized to how named exports are produced and verified via tests.
v6.2.0
v6.2.0 adds a new API surface that exposes supported style names (modifiers, foreground colors, background colors, and combined colors) as arrays and TypeScript union types. The code diff also refactors the internal style definitions to a module-level constant before assembling the exported `ansiStyles` mapping.
Featuresv6.1.1
Release v6.1.1 is described only as an internal refactoring. The code diff shows mostly formatting and lint-related changes, plus a small implementation refactor in the hex color parsing logic (index.js). No user-facing API changes are evident from the diff.
v6.1.0
Release v6.1.0 adds ANSI 16-color support alongside existing ANSI 256 and 16 million (truecolor) support. It introduces new conversion helpers (ansi256ToAnsi, rgbToAnsi, hexToAnsi) and a new .ansi(code) escape-code generator for both foreground and background styles.
Featuresv6.0.0
v6.0.0 upgrades ansi-styles to a Node 12+ only, pure ESM package. The implementation and typings were reorganized to support ESM default export and exported TypeScript types. The release notes only mention the ESM and Node requirement, but the diff shows additional behavioral and typing changes.
Breakingv5.2.0
Release v5.2.0 changes how ansi-styles color conversion helpers are exposed on the exported style object. The primary change is making the color conversion functions non-enumerable while keeping their behavior the same.
Breakingv5.1.0
Release v5.1.0 adds support for an ANSI overline text style. The package also updates TypeScript typings, documentation, and the test setup to recognize the new modifier.
Featuresv5.0.0
v5.0.0 dramatically simplifies the ansi-styles conversion surface by removing most color conversion support that previously depended on the color-convert package. It adds new direct conversion helpers (rgbToAnsi256, hexToRgb, hexToAnsi256), but it also changes the main API for applying those conversions to ansi codes.
BreakingFeaturesv4.3.0
v4.3.0 focuses on improving TypeScript typings for inline CSS color names used by ansi-styles. The implementation replaces reliance on the external color-name typings with an inlined CSS color string union type, and updates the README’s Tidelift messaging.
Features