MCPcopy
hub / github.com/ternjs/tern / findPackageFile

Function findPackageFile

plugin/node_resolve.js:39–48  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

37 };
38
39 function findPackageFile(dir) {
40 for (;;) {
41 try {
42 return JSON.parse(fs.readFileSync(path.resolve(dir, "package.json")));
43 } catch(e) {}
44 var shorter = path.dirname(dir);
45 if (shorter == dir) return null;
46 dir = shorter;
47 }
48 }
49
50 findDeclaredDeps = function(path, knownModules) {
51 var packageFile = findPackageFile(path);

Callers 1

node_resolve.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…