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

Function getPackageJsonPath

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

Source from the content-addressed store, hash-verified

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 ''

Callers 1

getAppVersionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected