| 216 | * @returns {string} |
| 217 | */ |
| 218 | export const getNodeModulesPackagePath = (packageName: string): string => { |
| 219 | const checkPaths = [ |
| 220 | path.join(__dirname, '..', 'node_modules', packageName), |
| 221 | path.join(__dirname, '..', '..', 'node_modules', packageName), |
| 222 | path.join(__dirname, '..', '..', '..', 'node_modules', packageName), |
| 223 | path.join(__dirname, '..', '..', '..', '..', 'node_modules', packageName), |
| 224 | path.join(__dirname, '..', '..', '..', '..', '..', 'node_modules', packageName) |
| 225 | ] |
| 226 | for (const checkPath of checkPaths) { |
| 227 | if (fs.existsSync(checkPath)) { |
| 228 | return checkPath |
| 229 | } |
| 230 | } |
| 231 | return '' |
| 232 | } |
| 233 | |
| 234 | /** |
| 235 | * Get input variables |