CodableJSON is a declarative JSON serialization library that aims to enable a whole new paradigm of data serialization in TypeScript/JavaScript. Using modern decorators ( @codableClass and @codable ), you can mark your data model classes as serializable instead of writing custom (to/from) JSON functions. Besides that, it's 3x faster SuperJSON alternative. Playground - Experiment with CodableJSON in the playground - Experiment with CodableJSON in the playground Documentation - Read the documentation Key Features Declarative and extensible : Mark props and classes as serializable instead of writing custom (to/from) JSON functions. : Mark props and classes as serializable instead of writing custom (to/from) JSON functions. SuperJSON drop-in replacement : ~3x faster than SuperJSON (see benchmark) : ~3x faster than SuperJSON (see benchmark) Type-safe : Full TypeScript support with autocompletion and type inference : Full TypeScript support with autocompletion and type inference Zero dependencies : Fully standalone, no external dependencies. Less than 10KB gziped. : Fully standalone, no external dependencies. Less than 10KB gziped. Well tested : Every feature is covered by tests. It passes most of SuperJSON tests moved into CodableJSON (including plenty of edge cases) : Every feature is covered by tests. It passes most of SuperJSON tests moved into CodableJSON (including plenty of edge cases) Framework agnostic : Works with any JavaScript/TypeScript project : Works with any JavaScript/TypeScript project Secure: Built-in protection against prototype pollution Installation npm install codablejson yarn add codablejson pnpm add codablejson Quick start 1. JSON Serialization Besides declarative framework (described below), it is also an ultra-fast SuperJSON alternative that can encode/decode almost any JavaScript input. import { encode , decode } from "codablejson" ; const data = { date : new Date ( "2025-01-01" ) , map : new Map ( [ [ "key" , "value" ] ] ) , } ; const encoded ...
First seen: 2025-11-14 06:50
Last seen: 2025-11-14 06:50