MCPcopy Index your code
hub / github.com/Waishnav/devspace / isMainModule

Function isMainModule

src/server.ts:1728–1734  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1726}
1727
1728async function isMainModule(): Promise<boolean> {
1729 if (!process.argv[1]) return false;
1730
1731 const modulePath = await realpath(fileURLToPath(import.meta.url));
1732 const entrypointPath = await realpath(process.argv[1]);
1733 return modulePath === entrypointPath;
1734}
1735
1736if (await isMainModule()) {
1737 const { app, config, close } = createServer();

Callers 1

server.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected