Skip to content

Supported Types

All structured-clonable types are supported via devalue:

TypeExample
string"hello"
number3.14, NaN, Infinity, -0
booleantrue, false
nullnull
undefinedundefined
Datenew Date()
RegExp/pattern/gi
Mapnew Map([["a", 1]])
Setnew Set([1, 2, 3])
BigInt42n
URLnew URL("https://example.com")
URLSearchParamsnew URLSearchParams("a=1")
ArrayBuffernew ArrayBuffer(8)
TypedArraysUint8Array, Int32Array, Float64Array, etc.
Nested objects{ a: { b: [1, 2] } }
Arrays[1, "two", null]
Circular referencesHandled automatically

Not supported

TypeReason
FunctionCannot be serialized. Use exports instead.
WeakMap / WeakRefNon-enumerable by design
DOM nodesBrowser-only objects

Streaming types

These are proxied rather than serialized:

TypeDirection
ReadableStreamServer to client
AsyncIterator / AsyncGeneratorServer to client

Released under the MIT License.