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

Function getLatestVersion

freebuff/cli/release/index.js:189–204  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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