# fetchLatestVersion()

[**PromptScript API**](https://getpromptscript.dev/api-reference/index.md)

***

# Function: fetchLatestVersion()

> **fetchLatestVersion**(): `Promise`\<`string` \| `null`\>

Defined in: [cli/src/utils/version-check.ts:153](https://github.com/mrwogu/promptscript/blob/49aa50f943865b985366c4eda6e95c5a31ef39a6/packages/cli/src/utils/version-check.ts#L153)

Fetch the latest version from npm registry.
Returns null on any network error.

## Returns

`Promise`\<`string` \| `null`\>