MCPcopy Create free account
hub / github.com/npmx-dev/npmx.dev / stripAnsi

Function stripAnsi

cli/src/npm-client.ts:149–153  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

147const AUTH_URL_TITLE_RE = /Authenticate your account at:\s*(https?:\/\/\S+)/
148
149function stripAnsi(text: string): string {
150 // eslint disabled because we need escape characters in regex
151 // eslint-disable-next-line no-control-regex, regexp/no-obscure-range
152 return text.replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, '')
153}
154
155const AUTH_URL_TIMEOUT_MS = 90_000
156

Callers 1

execNpmInteractiveFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected