Back to Explore

chalk/ansi-styles

GitHub
1 watchersOpen source

Last release: 9 months ago

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, evidenced by the latest tagged update (v6.2.3 on 2025-09-08) and an upstream push timestamp in 2026-02-27.
  • Update cadence appears irregular, with a large gap between v6.2.1 (2022-10-12) and v6.2.3 (2025-09-08), suggesting updates are not frequent but do occur when needed.

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v6.2.3

    9 months ago

    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.

    Security
  • v6.2.1

    10/12/2022

    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

    10/11/2022

    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.

    Features
  • v6.1.1

    9/10/2022

    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

    4/21/2021

    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.

    Features
  • v6.0.0

    4/16/2021

    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.

    Breaking
  • v5.2.0

    3/31/2021

    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.

    Breaking
  • v5.1.0

    1/22/2021

    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.

    Features
  • v5.0.0

    12/1/2020

    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.

    BreakingFeatures
  • v4.3.0

    10/4/2020

    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