MCPcopy
hub / github.com/npmx-dev/npmx.dev / fetchLatestVersion

Function fetchLatestVersion

shared/utils/npm.ts:28–35  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

26 * @see https://github.com/antfu/fast-npm-meta
27 */
28export async function fetchLatestVersion(name: string): Promise<string | null> {
29 try {
30 const meta = await getLatestVersion(name)
31 return meta.version
32 } catch {
33 return null
34 }
35}
36
37/**
38 * Validate an npm package name and throw an HTTP error if invalid.

Callers 1

Calls 1

getLatestVersionFunction · 0.85

Tested by

no test coverage detected