Node.js module

v8

The 'node:v8' module exposes APIs for heap snapshots and memory profiling. In Node.js these are V8-specific; Bun provides compatible implementations using JavaScriptCore.

Methods include v8.getHeapSnapshot(), v8.writeHeapSnapshot(), and v8.takeHeapSnapshot().

Works in Bun · notes

`writeHeapSnapshot` and `getHeapSnapshot` are implemented. `serialize` and `deserialize` use JavaScriptCore's wire format, not V8's. Most other V8-specific methods are not implemented. For profiling, consider using `bun:jsc`.

Functions 17

Classes 5

Interfaces 19

Types 2

Variables 1

Namespaces 1

  • namespace v8.startupSnapshot

    The v8.startupSnapshot interface can be used to add serialization and deserialization hooks for custom startup snapshots.