MCPcopy
hub / github.com/jishi/node-sonos-http-api / nodeModulesPathsSync

Function nodeModulesPathsSync

static/docs/lib/shred.bundle.js:90–103  ·  view source on GitHub ↗
(start)

Source from the content-addressed store, hash-verified

88 }
89
90 function nodeModulesPathsSync (start) {
91 var parts;
92 if (start === '/') parts = [ '' ];
93 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