superjson-codec
v1.0.1
Published
Safely serialize expressions to a superset of JSON, which includes Dates, BigInts, and more, while retaining the original object type
Readme
superjson-codec
Uses superjson to serialize expressions while retaining the original object type.
Accepts the following values, including arrays and objects:
stringnumberbooleanDatebigintMapSetArrayBufferInt8ArrayInt16ArrayInt32ArrayUint8ArrayUint16ArrayUint32ArrayUint8ClampedArrayRegExpErrorURLundefinednull
Installation
npm install superjson-codecUsage
import { stringify, parse } from "superjson-codec";
const encoded = stringify({
key: "value",
});
const decoded = parse(encoded);