MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / getVersion

Function getVersion

packages/components/src/utils.ts:1036–1058  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1034
1035let version: string
1036export const getVersion: () => Promise<{ version: string }> = async () => {
1037 if (version != null) return { version }
1038
1039 const checkPaths = [
1040 path.join(__dirname, '..', 'package.json'),
1041 path.join(__dirname, '..', '..', 'package.json'),
1042 path.join(__dirname, '..', '..', '..', 'package.json'),
1043 path.join(__dirname, '..', '..', '..', '..', 'package.json'),
1044 path.join(__dirname, '..', '..', '..', '..', '..', 'package.json')
1045 ]
1046 for (const checkPath of checkPaths) {
1047 try {
1048 const content = await fs.promises.readFile(checkPath, 'utf8')
1049 const parsedContent = JSON.parse(content)
1050 version = parsedContent.version
1051 return { version }
1052 } catch {
1053 continue
1054 }
1055 }
1056
1057 throw new Error('None of the package.json paths could be parsed')
1058}
1059
1060/**
1061 * Map Ext to InputField

Callers 2

initializeMongoDBFunction · 0.90
getClientMethod · 0.90

Calls 1

parseMethod · 0.65

Tested by

no test coverage detected