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

Function getAppVersion

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

Source from the content-addressed store, hash-verified

1959 * Get app current version
1960 */
1961export const getAppVersion = async () => {
1962 const getPackageJsonPath = (): string => {
1963 const checkPaths = [
1964 path.join(__dirname, '..', 'package.json'),
1965 path.join(__dirname, '..', '..', 'package.json'),
1966 path.join(__dirname, '..', '..', '..', 'package.json'),
1967 path.join(__dirname, '..', '..', '..', '..', 'package.json'),
1968 path.join(__dirname, '..', '..', '..', '..', '..', 'package.json')
1969 ]
1970 for (const checkPath of checkPaths) {
1971 if (fs.existsSync(checkPath)) {
1972 return checkPath
1973 }
1974 }
1975 return ''
1976 }
1977
1978 const packagejsonPath = getPackageJsonPath()
1979 if (!packagejsonPath) return ''
1980 try {
1981 const content = await fs.promises.readFile(packagejsonPath, 'utf8')
1982 const parsedContent = JSON.parse(content)
1983 return parsedContent.version
1984 } catch (error) {
1985 return ''
1986 }
1987}
1988
1989export const convertToValidFilename = (word: string) => {
1990 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