Back to Explore

chalk/ansi-styles

GitHub
1 updates · last 90 days2 watchersOpen source

Last release:

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 upstream repo shows recent activity, with an ansi-styles v7.0.0 update on 2026-07-26, and the change log indicates ongoing development (not a long silent period).
  • Update cadence: From the evidence, updates have been infrequent but not abandoned, with a gap of about 10 months between v6.2.3 (2025-09-08) and v7.0.0 (2026-07-26), and much longer gaps in earlier years.

AI summary generated

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

Recent updates

  • v7.0.0

    ansi-styles v7.0.0 bumps the minimum supported Node.js version to 22. It adds extended underline variants (double, curly, dotted, dashed) and introduces separate underline color support built on SGR 58.

    BreakingFeatures
  • 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.

    Security
  • v6.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.

    Features
  • v6.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.

    Features
  • v6.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.

    Breaking
  • v5.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.

    Breaking
  • v5.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.

    Features
  • v5.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.

    BreakingFeatures
  • v4.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