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

Function fetchPackument

server/utils/dependency-resolver.ts:21–31  ·  view source on GitHub ↗

* Fetch packument with caching (returns null on error for tree traversal). * Delegates to fetchNpmPackage() to share a single cache for all packument fetches.

(name: string)

Source from the content-addressed store, hash-verified

19 * Delegates to fetchNpmPackage() to share a single cache for all packument fetches.
20 */
21async function fetchPackument(name: string): Promise<Packument | null> {
22 try {
23 return await fetchNpmPackage(name)
24 } catch (error) {
25 if (import.meta.dev) {
26 // oxlint-disable-next-line no-console -- log npm registry failures for debugging
27 console.warn(`[dep-resolver] Failed to fetch packument for ${name}:`, error)
28 }
29 return null
30 }
31}
32
33/**
34 * Check if a package version matches the target platform.

Callers 1

resolveDependencyTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected