node:v8 API Reference

V8-shaped engine and heap compatibility helpers

Elide is not based on V8, but provides a small compatibility surface for packages that inspect heap statistics or serialize plain data.

OperationBehavior
cachedDataVersionTag()Returns a stable 32-bit tag for the running binary.
getHeapStatistics()Returns the Node-shaped heap-statistics object.
getHeapSpaceStatistics()Returns one entry per runtime memory pool.
setFlagsFromString(flags)Accepts a string and otherwise has no effect.
serialize(value)Encodes JSON.stringify(value) as UTF-8 in a Uint8Array.
deserialize(buffer)UTF-8 decodes and parses the JSON payload.

Pool names are runtime names such as eden space, not V8 names.

const v8 = require("node:v8");
const bytes = v8.serialize({ hello: "world" });
v8.deserialize(bytes); // { hello: "world" }

Serialization has JSON semantics. It is not compatible with V8’s structured-clone wire format, and circular objects throw TypeError.

See also