a Blazing fast json serialization and deserialization. Bigint,Date,Function,REgexp,Map and more.
- fast serialization and deserialization.
- lightweight - super small less than 5kb.
- Type safety with autocompletion
- multi-runtime - runs everywhere js runs.
- Framework agnostic
npm install @pouchlab/json- Map
- Set
- URL
- Strings
- Functions
- Regexp
- Date
- Bigint
- list
- object
- undefined
- null
import Json from "@pouchlab/json" //or import {Json} from "@pouchlab/json"
let m = new Set()
let ob = {
test:"hi"
}
//map
let map = new Map().set("ob",ob)
let rgx = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/
m.add([()=>{}])
m.add(["kkk",{ab:2,fn:async ()=>{},r: new Date(),x: rgx}])
console.log(Json.parse(Json.stringify({s:m,map,["aj",null,undefined],fn:async ()=>{},b:BigInt(5)})))support the development of this project,financial and code contribution are welcomed. Made with love by Pouchlabs & core-team.