MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / extractUrls

Function extractUrls

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

Source from the content-addressed store, hash-verified

132const URL_RE = /https?:\/\/[^\s<>"{}|\\^`[\]]+/g
133
134export function extractUrls(text: string): string[] {
135 const matches = text.match(URL_RE)
136 if (!matches) return []
137
138 const cleaned = matches.map(url => url.replace(/[.,;:!?)]+$/, ''))
139 return [...new Set(cleaned)]
140}
141
142// Patterns to detect npm's OTP prompt in pty output
143const OTP_PROMPT_RE = /Enter OTP:/i

Callers 3

executeOperationFunction · 0.90
npm-client.spec.tsFile · 0.90
execNpmInteractiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected