Back to Explore

chalk/wrap-ansi

GitHub
1 watchersOpen source

Last release:

Wraps a string containing ANSI escape codes to a specified column width, useful for formatting colored terminal output so lines do not exceed the desired width. Provides options such as hard wrapping, word-based wrapping, and trimming whitespace.

Project status

  • Active maintenance: The project has recent updates (v10.0.0 on 2026-02-20, and the last upstream push matches that date), indicating it is likely actively maintained as of today (2026-06-09).
  • Update cadence: Updates are somewhat bursty, with v10.0.0 (2026-02) after v9.0.2 (2025-09), then a longer gap to v9.0.0 (2023-10) and earlier updates. Overall, it looks like maintenance with periodic releases rather than frequent continuous updates.

AI summary generated

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

Recent updates

  • v10.0.0

    v10.0.0 modernizes wrap-ansi for Node.js 20+ and improves wrapping correctness for ANSI-styled text, including grapheme-aware wrapping and better handling of nested ANSI styles. It also fixes tab wrapping behavior and improves support for ST-terminated OSC hyperlinks. The release notes do not mention several implementation and dependency changes reflected in the diff.

    BreakingFeatures
  • v9.0.2

    Release v9.0.2 is documented as a security-related fix following v9.0.1. However, the provided code diff shows only a package.json version bump from 9.0.0 to 9.0.2, with no other code changes visible.

    Security
  • v9.0.0

    v9.0.0 primarily raises the minimum supported Node.js version to 18 and claims a performance improvement. The code diff shows several internal refactors around ANSI hyperlink handling and string indexing, plus dependency upgrades that are not called out in the release notes.

    Breaking
  • v8.1.0

    Release v8.1.0 primarily adds TypeScript support by introducing an index.d.ts file with an Options type and a typed wrapAnsi function signature. The implementation code is not shown as changed in this diff, but the package metadata and test tooling were updated to validate the types.

    Features
  • v8.0.1

    v8.0.1 is a small release with no apparent functional code changes to wrap-ansi itself. The primary changes in the diff are dependency version bumps in package.json and a minor refactor to a test assertion.

  • v8.0.0

    v8.0.0 makes wrap-ansi a breaking release by raising the minimum Node.js version to 12 and switching the package to pure ESM. The codebase was updated accordingly (imports/exports), and the dependencies were also upgraded to newer major versions.

    Breaking
  • v7.0.0

    v7.0.0 updates wrap-ansi to require Node.js 10+ and adds support for wrapping OSC 8 hyperlinks so they remain clickable in terminals that support ANSI hyperlinks. The implementation changes are largely centered around new parsing and emission of hyperlink escape sequences during line wrapping.

    BreakingFeatures
  • v6.2.0

    v6.2.0 updates the wrap-ansi dependency on strip-ansi from the v5 line to the v6 line. The diff indicates this is a dependency-only change, with no direct code logic modifications shown in this repository.

  • v6.1.0

    v6.1.0 adds newline normalization to wrap-ansi so input strings using Windows-style newlines are handled consistently. The implementation converts CRLF sequences to LF before wrapping, and tests and README were updated accordingly.

  • v6.0.0

    v6.0.0 primarily bumps the minimum supported Node.js version and updates several dependencies. The only code change in index.js is a small internal variable rename used while parsing ANSI escape sequences, which should not affect the public API.

    Breaking