Skip to content

chore: replace strip-ansi with node native stripVTControlCharacters#159

Closed
baevm wants to merge 1 commit into
shellscape:masterfrom
baevm:remove-strip-ansi-dep
Closed

chore: replace strip-ansi with node native stripVTControlCharacters#159
baevm wants to merge 1 commit into
shellscape:masterfrom
baevm:remove-strip-ansi-dep

Conversation

@baevm
Copy link
Copy Markdown

@baevm baevm commented May 17, 2026

This PR contains:

  • bugfix
  • feature
  • refactor
  • tests
  • documentation
  • metadata

Breaking Changes?

  • yes
  • no

If yes, please describe the breakage.

Please Describe Your Changes

Hi! This PR replaces strip-ansi dependency with nodejs native stripVTControlCharacters from node:util available since node 16.11.0

Copilot AI review requested due to automatic review settings May 17, 2026 14:09

This comment was marked as spam.

@shellscape
Copy link
Copy Markdown
Owner

Thanks for the PR. Quoting Sindre's README:

[!NOTE] Node.js has this built-in now with stripVTControlCharacters. The benefit of this package is consistent behavior across Node.js versions and faster improvements. The Node.js version is actually based on this package.

That's why we're using the package instead of the node builtin. It does need an update to the latest version, but I'm old school and trust Sindre to make solid updates faster than the Node team can. If you'd like to pivot this PR to updating that dep, that's cool and I'd merge that. Otherwise I thank you again for the contribution and you're welcome to close this one.

@baevm
Copy link
Copy Markdown
Author

baevm commented May 17, 2026

Thanks for the PR. Quoting Sindre's README:

[!NOTE] Node.js has this built-in now with stripVTControlCharacters. The benefit of this package is consistent behavior across Node.js versions and faster improvements. The Node.js version is actually based on this package.

That's why we're using the package instead of the node builtin. It does need an update to the latest version, but I'm old school and trust Sindre to make solid updates faster than the Node team can. If you'd like to pivot this PR to updating that dep, that's cool and I'd merge that. Otherwise I thank you again for the contribution and you're welcome to close this one.

Makes sense. My thinking was mostly that in this repo strip-ansi is only used for perf script, so it felt like a good place to use the node builtin and drop one extra package from the dev dependencies.

There’s also a small supply-chain angle here: even if strip-ansi itself is solid, it’s still another npm package to trust, and it was one of the packages compromised year ago: https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised.
If you’d rather keep strip-ansi, i can close this one

@shellscape
Copy link
Copy Markdown
Owner

Thanks for the follow-up. I'm good keeping the dep.

@baevm baevm closed this May 17, 2026
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.

3 participants