MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getLatestVersion

Function getLatestVersion

cli/release-staging/index.js:190–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

188}
189
190async function getLatestVersion() {
191 try {
192 const res = await httpGet(
193 `https://registry.npmjs.org/${packageName}/latest`,
194 )
195
196 if (res.statusCode !== 200) return null
197
198 const body = await streamToString(res)
199 const packageData = JSON.parse(body)
200
201 return packageData.version || null
202 } catch (error) {
203 return null
204 }
205}
206
207function streamToString(stream) {
208 return new Promise((resolve, reject) => {

Callers 2

ensureBinaryExistsFunction · 0.70
checkForUpdatesFunction · 0.70

Calls 3

parseMethod · 0.80
httpGetFunction · 0.70
streamToStringFunction · 0.70

Tested by

no test coverage detected