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

Function nodeRuntimeFlagsFor

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

Source from the content-addressed store, hash-verified

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

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected