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
- The source appears actively maintained, with multiple tagged versions including a recent update on 2026-02-20 (v10.0.0) and prior updates in 2025 (v9.0.2) and 2023 (v9.0.0).
- Update cadence looks irregular but ongoing, with a gap between v9.0.2 (2025-09-08) and v10.0.0 (2026-02-20) of about 5.5 months, and a larger gap between v9.0.0 (2023-10-28) and v9.0.2 (2025-09-08) of about 22 months.
AI summary generated Today
Recent updates
v10.0.0
3 months agov10.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.
BreakingFeaturesv9.0.2
9 months agoRelease 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.
Securityv9.0.0
10/28/2023v9.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.
Breakingv8.1.0
1/23/2023Release 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.
Featuresv8.0.1
9/13/2021v8.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
4/16/2021v8.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.
Breakingv7.0.0
4/22/2020v7.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.
BreakingFeaturesv6.2.0
11/11/2019v6.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
10/23/2019v6.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
6/11/2019v6.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