strip-ansi
npmstrip-ansi
Strip ANSI escape codes from a string
[!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.
Install
Shell
npm install strip-ansiUsage
JavaScript
import stripAnsi from 'strip-ansi';
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'Related
- strip-ansi-cli - CLI for this module
- strip-ansi-stream - Streaming version of this module
- has-ansi - Check if a string has ANSI escape codes
- ansi-regex - Regular expression for matching ANSI escape codes
- chalk - Terminal string styling done right
Maintainers
Install
Repository
github.com/chalk/strip-ansiWeekly Downloads
375.2M
Version
7.1.2License
MITLast Scanned
2 days ago
Maintainers
S
sindresorhusCapabilities
Process
Spawns child processes