Strip ANSI escape codes from strings with consistent behavior across Node.js versions.
strip-ansi is a Node.js package that removes ANSI escape codes from strings. These codes are used for terminal text styling like colors, bold text, and hyperlinks. It solves the problem of cleaning up formatted terminal output when you need plain text.
Node.js developers working with CLI tools, terminal output, or any application that processes styled terminal text and needs to extract clean content.
Developers choose strip-ansi for its consistent behavior across Node.js versions and faster improvements compared to Node.js's built-in stripVTControlCharacters. It's part of the popular chalk ecosystem and handles various ANSI code types reliably.
Strip ANSI escape codes from a string
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Ensures reliable stripping across Node.js versions, as the README highlights that Node.js's built-in stripVTControlCharacters varies, making this package a stable choice.
Offers faster improvements and optimized performance compared to Node.js's native method, which is based on this package but may lag in updates.
Handles diverse ANSI sequences including SGR for styling and OSC for hyperlinks, demonstrated in the usage examples with color codes and link stripping.
Part of the widely-used chalk ecosystem, ensuring maintenance and seamless compatibility with related tools like ansi-regex and has-ansi.
Node.js now includes stripVTControlCharacters, making this package superfluous for simple use cases where built-in functionality is sufficient and edge cases aren't a concern.
Limited to Node.js environments; it cannot be used directly in browsers or other runtimes without additional workarounds or polyfills.
Adds an extra package to projects, which might be unnecessary overhead if ANSI stripping is a minor or infrequent requirement in the codebase.