Skip to content

Replace strip-ansi dependency with built-in util.stripVTControlCharacters#61

Open
Jah-yee wants to merge 1 commit into
chalk:mainfrom
Jah-yee:replace-strip-ansi-with-util
Open

Replace strip-ansi dependency with built-in util.stripVTControlCharacters#61
Jah-yee wants to merge 1 commit into
chalk:mainfrom
Jah-yee:replace-strip-ansi-with-util

Conversation

@Jah-yee

@Jah-yee Jah-yee commented May 5, 2026

Copy link
Copy Markdown

What

Replaces the external strip-ansi dependency with Node.js built-in util.stripVTControlCharacters API.

Why

  • Available since Node v16.11.0 — no compatibility concern since the package requires Node >= 20
  • Removes an unnecessary external dependency
  • One less package to install for consumers of wrap-ansi

Changes

  • index.js: Replace import stripAnsi from "strip-ansi" with import {stripVTControlCharacters as stripAnsi} from "node:util"
  • test.js: Same import replacement
  • package.json: Remove strip-ansi from dependencies

Verification

All 54 existing tests pass with this change.

Fixes #55

…ters

Removes the external strip-ansi dependency in favor of Node.js's
built-in util.stripVTControlCharacters API (available since v16.11.0).
The package already requires Node >= 20, so there are no compatibility
concerns.

Fixes chalk#55
@Jah-yee

Jah-yee commented May 11, 2026

Copy link
Copy Markdown
Author

Hi @chalk/maintainers, gentle ping - this replaces strip-ansi with a built-in util. Let me know if you'd like any changes! 🙏

@sindresorhus

Copy link
Copy Markdown
Member

I will get to it when I can. This is not very urgent.

@Jah-yee

Jah-yee commented Jun 5, 2026

Copy link
Copy Markdown
Author

👋 Hi maintainers, just checking in. Let me know if there's anything I can improve!

@Jah-yee

Jah-yee commented Jun 6, 2026

Copy link
Copy Markdown
Author

Hi! Just checking in — this PR has been open for 30+ days with no review. Happy to make any adjustments if needed. Thanks! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace strip-ansi dependency with util.stripVTControlCharacters

2 participants