MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / findNearestNodeModules

Function findNearestNodeModules

packages/node/src/dev/hotStateReload.ts:246–259  ·  view source on GitHub ↗
(startDir: string)

Source from the content-addressed store, hash-verified

244}
245
246function findNearestNodeModules(startDir: string): string | null {
247 let current = resolve(startDir);
248 while (true) {
249 const candidate = join(current, "node_modules");
250 try {
251 if (statSync(candidate).isDirectory()) return candidate;
252 } catch {
253 // Keep walking up.
254 }
255 const parent = dirname(current);
256 if (parent === current) return null;
257 current = parent;
258 }
259}
260
261function createReloadAdapter<S>(opts: HotStateReloadOptions<S>): Readonly<{
262 entryModule: string | URL;

Callers 1

createHotStateReloadFunction · 0.85

Calls 1

resolveFunction · 0.85

Tested by

no test coverage detected