MCPcopy
hub / github.com/FlowiseAI/Flowise / getAppVersion

Function getAppVersion

packages/server/src/utils/index.ts:1952–1978  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1950 * Get app current version
1951 */
1952export const getAppVersion = async () => {
1953 const getPackageJsonPath = (): string => {
1954 const checkPaths = [
1955 path.join(__dirname, '..', 'package.json'),
1956 path.join(__dirname, '..', '..', 'package.json'),
1957 path.join(__dirname, '..', '..', '..', 'package.json'),
1958 path.join(__dirname, '..', '..', '..', '..', 'package.json'),
1959 path.join(__dirname, '..', '..', '..', '..', '..', 'package.json')
1960 ]
1961 for (const checkPath of checkPaths) {
1962 if (fs.existsSync(checkPath)) {
1963 return checkPath
1964 }
1965 }
1966 return ''
1967 }
1968
1969 const packagejsonPath = getPackageJsonPath()
1970 if (!packagejsonPath) return ''
1971 try {
1972 const content = await fs.promises.readFile(packagejsonPath, 'utf8')
1973 const parsedContent = JSON.parse(content)
1974 return parsedContent.version
1975 } catch (error) {
1976 return ''
1977 }
1978}
1979
1980export const convertToValidFilename = (word: string) => {
1981 return word

Callers 13

executeUpsertFunction · 0.90
executeFlowFunction · 0.90
sendTelemetryMethod · 0.90
emitEventFunction · 0.90
createToolFunction · 0.90
createEvaluationFunction · 0.90
saveChatflowFunction · 0.90
createVariableFunction · 0.90
createDocumentStoreFunction · 0.90
createCustomMcpServerFunction · 0.90
createAssistantFunction · 0.90

Calls 2

getPackageJsonPathFunction · 0.70
parseMethod · 0.65

Tested by

no test coverage detected