[ Web Proxy ]
URL:
Viewing: https://codablejson.com/docs/json-serialization [Back]  [Original]

JSON Serialization Overview - CodableJSONSkip to Content
CodableJSON
DocumentationPlayground

On This Page

DocumentationJSON SerializationOverview

JSON Serialization Overview

CodableJSON provides high-performance JSON serialization that extends standard JSON to handle JavaScript types that JSON cant serialize natively.

Quick Start

import { encode, decode } from "codablejson"; const data = { date: new Date("2025-01-01"), set: new Set(["a", "b", "c"]), map: new Map([["key", "value"]]), }; const encoded = encode(data); // Result: { // date: { $$Date: "2025-01-01T00:00:00.000Z" }, // set: { $$Set: ["a", "b", "c"] }, // map: { $$Map: [["key", "value"]] } // } const decoded = decode(encoded); // decoded.date instanceof Date === true

Open playground to test your own data.

Key Features

Stringify & Parse

For convenience, CodableJSON provides stringify and parse functions that combine encoding/decoding with JSON stringification:

import { stringify, parse } from "codablejson"; const jsonString = stringify(data); const restored = parse(jsonString);

Try It Out

Experiment with CodableJSON in the playground to see how different types are encoded and test circular reference handling.

Last updated on November 15, 2025
Quick StartSupported Types

MIT 2025 CodableJSON.

Web Proxy Viewer  |  New URL  |  Original Page