/** * @file Node.js runtime version and capability helpers. Provides getters for * the current Node version (major/minor/patch), the maintained-versions list, * and feature-detection flags for APIs that vary across Node releases. */ /** * Get the absolute path to the currently running Node.js binary. * * @returns The value of `getNodeProcess().execPath`. */ export declare function getExecPath(): string; /** * Get the list of Node.js major versions currently under long-term support. * * @returns The static `maintainedNodeVersions` array shared across the library. */ export declare function getMaintainedNodeVersions(): readonly string[] & { current: string; last: string; next: string; previous: string; }; /** * Get the flags used to block Node.js debugger attachment via SIGUSR1. Returns * `['--disable-sigusr1']` on runtimes that support it and falls back to * `['--no-inspect']` on older versions. * * @returns A non-empty array of CLI flags suitable for passing to `node`. */ export declare function getNodeDisableSigusr1Flags(): string[]; /** * Get the hardening flags Socket applies when spawning Node.js subprocesses. * Always includes `--disable-proto=delete`. Also adds `--permission` plus the * grants from {@link getNodePermissionFlags} on Node 24+, * `--experimental-permission` on Node 20-23, and * `--force-node-api-uncaught-exceptions-policy` on Node 22+. * * @returns A non-empty array of CLI flags suitable for passing to `node`. */ export declare function getNodeHardenFlags(): string[]; /** * Get the major component of the current Node.js version. * * @returns The major version number, or `0` if it cannot be parsed. */ export declare function getNodeMajorVersion(): number; /** * Get the minor component of the current Node.js version. * * @returns The minor version number, or `0` if it cannot be parsed. */ export declare function getNodeMinorVersion(): number; /** * Get the flags that silence Node.js runtime warnings and deprecation notices. * Always returns `['--no-warnings', '--no-deprecation']` across all versions. * * @returns A non-empty array of CLI flags suitable for passing to `node`. */ export declare function getNodeNoWarningsFlags(): string[]; /** * Get the patch component of the current Node.js version. * * @returns The patch version number, or `0` if it cannot be parsed. * * @unused No internal or Socket consumers; exercised only by its unit tests. */ export declare function getNodePatchVersion(): number; /** * Get the permission-grant flags needed to run npm under Node.js 24+'s * `--permission` model. The array is non-empty only on Node.js 24+ and includes * `--allow-fs-read=*`, `--allow-fs-write=*`, and `--allow-child-process`. Older * versions return an empty array. * * @returns The possibly-empty permission flag list for the current runtime. */ export declare function getNodePermissionFlags(): string[]; /** * Get the full Node.js version string from `getNodeProcess().version`. * * @returns The runtime version, including the leading `v` (e.g. `v22.11.0`). */ export declare function getNodeVersion(): string; /** * Check whether the current runtime exposes the `module.enableCompileCache()` * API. The API is available on Node.js 24+. * * @returns `true` when the current runtime is Node.js 24 or newer. * * @unused No internal or Socket consumers; exercised only by its unit tests. */ export declare function supportsNodeCompileCacheApi(): boolean; /** * Check whether the current runtime honors the `NODE_COMPILE_CACHE` env var. * Env-var-based compile caching is available on Node.js 22+. * * @returns `true` when the current runtime is Node.js 22 or newer. * * @unused No internal or Socket consumers; exercised only by its unit tests. */ export declare function supportsNodeCompileCacheEnvVar(): boolean; /** * Check whether the current runtime supports the `--disable-sigusr1` CLI flag. * Flag landed in v22.14.0 and v23.7.0 and was stabilized in v22.20.0 / * v24.8.0. * * @returns `true` when the runtime exposes `--disable-sigusr1`. */ export declare function supportsNodeDisableSigusr1Flag(): boolean; /** * Check whether the current runtime supports the `--disable-warning` CLI flag. * The flag is available on Node.js 21+. * * @returns `true` when the current runtime is Node.js 21 or newer. * * @unused No internal or Socket consumers; exercised only by its unit tests. */ export declare function supportsNodeDisableWarningFlag(): boolean; /** * Check whether the current runtime supports the permission model CLI flags * (`--experimental-permission` on Node 20-23, `--permission` on Node 24+). * * @returns `true` when the current runtime is Node.js 20 or newer. * * @unused No internal or Socket consumers; exercised only by its unit tests. */ export declare function supportsNodePermissionFlag(): boolean; /** * Check whether `require()` can synchronously load ESM modules. Requires * Node.js 22.12+ or Node.js 23+. * * @returns `true` when the runtime supports `require()`-ing ES modules. * * @unused No internal or Socket consumers; exercised only by its unit tests. */ export declare function supportsNodeRequireModule(): boolean; /** * Check whether the current runtime supports `node --run