🚀 Feature: Replace strip-ansi with util.stripVTControlCharacters
#5265
Open
Description
Feature Request Checklist
- I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
- I have searched for related issues and issues with the
faq
label, but none matched my issue. - I want to provide a PR to resolve this
Overview
I ran eslint-plugin-depend
on the Mocha repo. Here's one of the outputs:
/Users/josh/repos/mocha/docs/_data/usage.js
3:19 error "strip-ansi" should be replaced with an alternative package. Read more here: https://github.com/es-tooling/module-replacements/blob/main/docs/modules/strip-ansi.md depend/ban-dependencies
Perhttps://github.com/es-tooling/module-replacements/blob/main/docs/modules/strip-ansi.md:
strip-ansi
is a simple utility function that can be replaced with native APIs....
Added in v16.11.0,
util.stripVTControlCharacters
can be used to strip ANSI escape codes from a string.
Suggested Solution
One less dependency is always nice IMO! Now v11 is shipped and we don't support Node <18.18, I think we can rely on node:util
existing.
Proposal: let's drop the strip-ansi
dependency in favor of util.stripVTControlCharacters
?
Alternatives
We could stay on strip-ansi
, but I see no reason to.
Additional Info
💖
Activity