V8
v8.deserialize()
Decodes data produced by the serialization API. Treat stored bytes as data with a version and integrity policy; validate the decoded application shape. Tested on Node.js 22.16.0. Example output (one line per entry): ["3 true true"].
Formal Syntax & Structure
nodejs syntaxnodejs
v8.deserialize(buffer)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| buffer | Buffer | TypedArray | DataView | Serialized bytes. |
Return Value
unknown
Decoded value.
Working Example
Example Snippetnodejs
import { serialize, deserialize } from 'node:v8';const obj = { id: 3 };obj.self = obj;const copy = deserialize(serialize(obj));console.log(copy.id, copy.self === copy, copy !== obj);