MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / getDependencyPath

Function getDependencyPath

packages/vite/helpers/utils.ts:82–92  ·  view source on GitHub ↗
(dependencyName: string)

Source from the content-addressed store, hash-verified

80 * @param dependencyName
81 */
82export function getDependencyPath(dependencyName: string): string | null {
83 try {
84 const resolvedPath = require.resolve(`${dependencyName}/package.json`, {
85 paths: [getProjectRootPath()],
86 });
87
88 return path.dirname(resolvedPath);
89 } catch (err) {
90 return null;
91 }
92}
93
94/**
95 * Get the version of a dependency from package.json

Callers 1

applyExternalConfigsFunction · 0.70

Calls 2

resolveMethod · 0.80
getProjectRootPathFunction · 0.70

Tested by

no test coverage detected