utils/getLatestVersion
Esta página aún no está disponible en tu idioma.
Functions
Section titled “Functions”getLatestVersion()
Section titled “getLatestVersion()”function getLatestVersion( packageName: string, logger: AstroIntegrationLogger, cacheJsonFile: undefined | URL,isDevMode: boolean): Promise<null | string>
Defined in: studiocms/packages/studiocms/src/utils/getLatestVersion.ts:15^
Fetches the latest version of a given npm package from the npm registry.
Parameters
Section titled “Parameters”packageName
Section titled “packageName”string
The name of the npm package to fetch the latest version for.
logger
Section titled “logger”AstroIntegrationLogger
An instance of AstroIntegrationLogger
used to log errors if the fetch fails.
cacheJsonFile
Section titled “cacheJsonFile”undefined
| URL
isDevMode
Section titled “isDevMode”boolean
Returns
Section titled “Returns”Promise
<null
| string
>
A promise that resolves to the latest version of the package as a string,
or null
if an error occurs during the fetch process.
Throws
Section titled “Throws”Will throw an error if the HTTP response from the npm registry is not successful.