javascript-object-compress
v1.1.1
Published
A tool for compressing JavaScript objects to Uint8Array
Maintainers
Readme
javascript-object-compress
A tool for compressing JavaScript objects to Uint8Array
Usage
import {compress, decompress} from "javascript-opject-compress";
const obj = {
a: 1,
b: [2, 3],
c: new Date(),
d: new File([Uint8Array.from([1, 2, 3])], "file", {
type: "text/plain"
})
};
// Circular referencing is supported
obj.self = obj;
compress(obj).then(compressed => {
const decompressed = decompress(compressed);
});Supported types
stringnumberbigintbooleanundefinednullDateInt8ArrayUint8ArrayUint8ClampedArrayInt16ArrayUint16ArrayInt32ArrayUint32ArrayFloat32ArrayFloat64ArrayBigInt64ArrayBigUint64ArrayArrayBufferFileBlobArrayObjectMapSet
