MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / nodeRuntimeFlagsFor

Function nodeRuntimeFlagsFor

src/extraction/wasm-runtime-flags.ts:63–71  ·  view source on GitHub ↗
(nodeVersion: string)

Source from the content-addressed store, hash-verified

61 * warning.
62 */
63export function nodeRuntimeFlagsFor(nodeVersion: string): readonly string[] {
64 // `--disable-warning` landed in Node 20.11 / 21.3; older nodes treat it as
65 // a fatal "bad option" at spawn. Those runtimes can't run codegraph anyway
66 // (node:sqlite needs >= 22.5), but let them reach our own version messaging
67 // instead of a cryptic spawn failure.
68 const [major = 0, minor = 0] = nodeVersion.split('.').map(Number);
69 const supported = major > 21 || (major === 21 && minor >= 3) || (major === 20 && minor >= 11);
70 return supported ? ['--disable-warning=ExperimentalWarning', '--max-semi-space-size=16'] : [];
71}
72
73export const NODE_RUNTIME_FLAGS: readonly string[] = nodeRuntimeFlagsFor(process.versions.node);
74

Callers 2

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected