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

Function nodeRuntimeFlagsFor

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

Source from the content-addressed store, hash-verified

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

Callers 2

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected