teleport-javascript
A super light and fast JavaScript object (de)serialization that includes Date, BigInt, RegExp, etc.
Installation
$ npm -i teleport-javascript
Usage
const {parse, stringify} = require('teleport-javascript');
const obj = {
key: 'value',
undefined: undefined,
regex: /a-z/gi,
set: new Set([-Infinity, NaN, Infinity]),
bigint: 900719925474099123n,
symbol: Symbol('key')
};
obj.circular = obj;
const stringified = stringify(obj);
const parsed = parse(stringified);
Supported Data Types
- String
- Number (including NaN, Infinity, -Infinity)
- BigInt
- Boolean
- Symbol
- Null
- Undefined
- Array
- Int8Array
- Uint8Array
- Uint8ClampedArray
- Int16Array
- Uint16Array
- Int32Array
- Uint32Array
- Float32Array
- Float64Array
- Object (including circular reference)
Benchmarks
Benchmark Results
License
ISC