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

Function getNodeModulesPackagePath

packages/server/src/utils/index.ts:133–147  ·  view source on GitHub ↗
(packageName: string)

Source from the content-addressed store, hash-verified

131 * @returns {string}
132 */
133export const getNodeModulesPackagePath = (packageName: string): string => {
134 const checkPaths = [
135 path.join(__dirname, '..', 'node_modules', packageName),
136 path.join(__dirname, '..', '..', 'node_modules', packageName),
137 path.join(__dirname, '..', '..', '..', 'node_modules', packageName),
138 path.join(__dirname, '..', '..', '..', '..', 'node_modules', packageName),
139 path.join(__dirname, '..', '..', '..', '..', '..', 'node_modules', packageName)
140 ]
141 for (const checkPath of checkPaths) {
142 if (fs.existsSync(checkPath)) {
143 return checkPath
144 }
145 }
146 return ''
147}
148
149/**
150 * Construct graph and node dependencies score

Callers 3

configMethod · 0.90
initializeNodesMethod · 0.90
initializeCredentialsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected