A function that can be used to replace ANSI escape sequences in a string.
Additional arguments passed by the String.prototype.replace method.
String.prototype.replace
The replacement string.
0.1.3
const replacer: ReplacerFn = (match) => match === "\u001b[31m" ? "" : match;replaceAnsi("\u001b[31mHello\u001b[39m", replacer); Copy
const replacer: ReplacerFn = (match) => match === "\u001b[31m" ? "" : match;replaceAnsi("\u001b[31mHello\u001b[39m", replacer);
A function that can be used to replace ANSI escape sequences in a string.