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

Function getPackageJsonPath

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

Source from the content-addressed store, hash-verified

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

Callers 1

getAppVersionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected