@andersgee/jsone
v0.1.0
Published
json stringify/parse that also handles Date, BigInt, TypedArray
Downloads
23
Maintainers
Readme
jsone
JSON stringify/parse that can handle Date, BigInt and TypedArrays.
zero dependencies, works in the browser aswell.
example usage
npm install @andersgee/jsone
import { JSONE } from "@andersgee/jsone";
const str = JSONE.stringify({
myString: "hello",
myNumber: 2,
myBigint: 8n,
myDate: new Date(),
myTypedarray: new Uint8Array([1, 2, 3, 4]),
});
console.log(JSONE.parse(str));
//{
// myString: 'hello',
// myNumber: 2,
// myBigint: 8n,
// myDate: 2024-07-14T16:28:13.934Z,
// myTypedarray: Uint8Array(4) [ 1, 2, 3, 4 ]
//}