MCPcopy Create free account
hub / github.com/npm/cli / versionNotExists

Function versionNotExists

scripts/publish.js:37–48  ·  view source on GitHub ↗
({ name, version })

Source from the content-addressed store, hash-verified

35}
36
37const versionNotExists = async ({ name, version }) => {
38 const spec = `${name}@${version}`
39 let exists
40 try {
41 await pacote.manifest(spec, { preferOnline: true })
42 exists = true // if it exists, no publish needed
43 } catch {
44 exists = false // otherwise its needs publishing
45 }
46 log.info(`${spec} exists=${exists}`)
47 return !exists
48}
49
50const getPublishes = async ({ force }) => {
51 const publishPackages = []

Callers 1

getPublishesFunction · 0.85

Calls 1

manifestMethod · 0.80

Tested by

no test coverage detected