MCPcopy Create free account
hub / github.com/browserify/crypto-browserify / nodeModulesPathsSync

Function nodeModulesPathsSync

example/bundle.js:91–103  ·  view source on GitHub ↗
(start)

Source from the content-addressed store, hash-verified

89 }
90
91 function nodeModulesPathsSync(start) {
92 var parts;
93 if (start === '/') { parts = ['']; } else { parts = path.normalize(start).split('/'); }
94
95 var dirs = [];
96 for (var i = parts.length - 1; i >= 0; i--) {
97 if (parts[i] === 'node_modules') { continue; }
98 var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
99 dirs.push(dir);
100 }
101
102 return dirs;
103 }
104 };
105}());
106

Callers 1

loadNodeModulesSyncFunction · 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…