Skip to content

skyrpex/superjson-codec

Repository files navigation

superjson-codec

Uses superjson to serialize expressions while retaining the original object type.

Accepts the following values, including arrays and objects:

  • string
  • number
  • boolean
  • Date
  • bigint
  • Map
  • Set
  • ArrayBuffer
  • Int8Array
  • Int16Array
  • Int32Array
  • Uint8Array
  • Uint16Array
  • Uint32Array
  • Uint8ClampedArray
  • RegExp
  • Error
  • URL
  • undefined
  • null

Installation

npm install superjson-codec

Usage

import { stringify, parse } from "superjson-codec";

const encoded = stringify({
	key: "value",
});

const decoded = parse(encoded);

Other codecs

About

Uses superjson to serialize expressions while retaining the original object type.

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •