diff --git a/docs/modules/wrap-ansi.md b/docs/modules/wrap-ansi.md new file mode 100644 index 0000000..3b13bad --- /dev/null +++ b/docs/modules/wrap-ansi.md @@ -0,0 +1,18 @@ +--- +description: Modern replacement for the wrap-ansi package for wrapping terminal strings (including ANSI-colored output) +--- + +# Replacements for `wrap-ansi` + +## `fast-wrap-ansi` + +[`fast-wrap-ansi`](https://github.com/43081j/fast-wrap-ansi) is a drop‑in replacement for `wrap-ansi` that’s faster and smaller. + +```ts +import wrapAnsi from 'wrap-ansi' // [!code --] +import wrapAnsi from 'fast-wrap-ansi' // [!code ++] + +const value = '\u001B[36mhello-super-long-token-without-spaces\u001B[39m' + +console.log(wrapAnsi(value, 12, { hard: true, trim: false })) +``` diff --git a/manifests/preferred.json b/manifests/preferred.json index e275345..c14a977 100644 --- a/manifests/preferred.json +++ b/manifests/preferred.json @@ -2690,6 +2690,12 @@ "replacements": ["fetch", "ofetch", "ky"], "url": {"type": "e18e", "id": "fetch"} }, + "wrap-ansi": { + "type": "module", + "moduleName": "wrap-ansi", + "replacements": ["fast-wrap-ansi"], + "url": {"type": "e18e", "id": "wrap-ansi"} + }, "xmldom": { "type": "module", "moduleName": "xmldom", @@ -3027,6 +3033,11 @@ "type": "documented", "replacementModule": "fast-uri" }, + "fast-wrap-ansi": { + "id": "fast-wrap-ansi", + "type": "documented", + "replacementModule": "fast-wrap-ansi" + }, "fdir": {"id": "fdir", "type": "documented", "replacementModule": "fdir"}, "fetch": { "id": "fetch",