{"name":"seroval","version":"1.5.3","keywords":["pridepack"],"author":{"name":"Alexis Munsayac"},"license":"MIT","_id":"seroval@1.5.3","maintainers":[{"name":"lxsmnsyc","email":"alexis.munsayac@gmail.com"},{"name":"schiller-manuel","email":"meisterpink@gmail.com"}],"homepage":"https://github.com/lxsmnsyc/seroval/tree/main/packages/seroval","bugs":{"url":"https://github.com/lxsmnsyc/seroval/issues"},"dist":{"shasum":"65401b794ef19e897635a2f2e874a54ca5f2e6f7","tarball":"http://registry-npm.ywwl.com/seroval/download/seroval-1.5.3.tgz","fileCount":108,"integrity":"sha512-BXe0x4buEeYiIKaRUnth1WqCILQ3k4O67KP/B4pC3pVz0Mv2c96ngA9QDREUYxWY1sb2RZVRqwI9RcpVMyHCVw==","signatures":[{"sig":"MEUCIQD3ju6pD+aiwurjBEFzPmx9kSngR71Q4p9VYYc67KsZ+gIgPVNeqYbmv6MxTBT0XfZiDxomF0K0luEVKKoOpnlnll8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1071703,"size":206063,"noattachment":false,"key":"/seroval/-/seroval-1.5.3.tgz"},"main":"./dist/cjs/production/index.cjs","type":"module","_from":"file:seroval-1.5.3.tgz","types":"./dist/types/index.d.ts","module":"./dist/esm/production/index.mjs","engines":{"node":">=10"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/production/index.mjs","require":"./dist/cjs/production/index.cjs","development":{"import":"./dist/esm/development/index.mjs","require":"./dist/cjs/development/index.cjs"}}},"private":false,"scripts":{"dev":"pridepack dev","test":"vitest","build":"pridepack build","clean":"pridepack clean","prune":"ts-prune","start":"pridepack start","watch":"pridepack watch","test:ui":"vitest --ui","type-check":"pridepack check"},"_npmUser":{"name":"lxsmnsyc","email":"alexis.munsayac@gmail.com"},"_resolved":"/private/var/folders/fw/p8bv1hrs1119xqjldy51x8780000gn/T/813ef72d8cf5e976fd93ff5d18f21871/seroval-1.5.3.tgz","_integrity":"sha512-BXe0x4buEeYiIKaRUnth1WqCILQ3k4O67KP/B4pC3pVz0Mv2c96ngA9QDREUYxWY1sb2RZVRqwI9RcpVMyHCVw==","repository":{"url":"git+https://github.com/lxsmnsyc/seroval.git","type":"git"},"_npmVersion":"10.9.4","description":"Stringify JS values","directories":{},"_nodeVersion":"22.12.0","publishConfig":{"access":"public"},"typesVersions":{"*":{}},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.8.1","vitest":"^4.0.6","ts-prune":"^0.10.3","pridepack":"2.6.4","@vitest/ui":"^4.0.6","typescript":"^5.9.3","@types/node":"^24.10.0"},"_npmOperationalInternal":{"tmp":"tmp/seroval_1.5.3_1777876687620_0.029564917279183645","host":"s3://npm-registry-packages-npm-production"},"readme":"# seroval\n\n> Stringify JS values\n\n[![NPM](https://img.shields.io/npm/v/seroval.svg)](https://www.npmjs.com/package/seroval) [![JavaScript Style Guide](https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb)](https://github.com/airbnb/javascript)\n\n## Install\n\n```bash\nnpm install --save seroval\n```\n\n```bash\nyarn add seroval\n```\n\n```bash\npnpm add seroval\n```\n\n## Usage\n\n```js\nimport { serialize } from 'seroval';\n\nconst object = {\n  number: [Math.random(), -0, NaN, Infinity, -Infinity],\n  string: ['hello world', '<script>Hello World</script>'],\n  boolean: [true, false],\n  null: null,\n  undefined: undefined,\n  bigint: 9007199254740991n,\n  array: [,,,], // holes\n  regexp: /[a-z0-9]+/i,\n  date: new Date(),\n  map: new Map([['hello', 'world']]),\n  set: new Set(['hello', 'world']),\n};\n\n// self cyclic references\n// recursive objects\nobject.self = object;\n// recursive arrays\nobject.array.push(object.array);\n// recursive maps\nobject.map.set('self', object.map);\n// recursive sets\nobject.set.add(object.set);\n\n// mutual cyclic references\nobject.array.push(object.map);\nobject.map.set('mutual', object.set);\nobject.set.add(object.array);\n\nconst result = serialize(object);\nconsole.log(result);\n```\n\nOutput (as a string):\n\n```js\n((h,j,k,m,o)=>(o={number:[0.5337763749243287,-0,0/0,1/0,-1/0],string:[\"hello world\",\"\\x3Cscript>Hello World\\x3C/script>\"],boolean:[!0,!1],null:null,undefined:void 0,bigint:9007199254740991n,array:h=[,,,,k=(j=[],new Map([[\"hello\",\"world\"],[\"mutual\",m=new Set([\"hello\",\"world\"])]]))],regexp:/[a-z0-9]+/i,date:new Date(\"2023-12-07T17:28:57.909Z\"),map:k,set:m},h[3]=h,k.set(\"self\",k),m.add(m).add(h),o.self=o,o))()\n\n// Formatted for readability\n((h, j, k, m, o) => (\n  (o = {\n    number: [0.5337763749243287, -0, 0 / 0, 1 / 0, -1 / 0],\n    string: [\"hello world\", \"\\x3Cscript>Hello World\\x3C/script>\"],\n    boolean: [!0, !1],\n    null: null,\n    undefined: void 0,\n    bigint: 9007199254740991n,\n    array: (h = [\n      ,\n      ,\n      ,\n      ,\n      (k =\n        ((j = []),\n        new Map([\n          [\"hello\", \"world\"],\n          [\"mutual\", (m = new Set([\"hello\", \"world\"]))],\n        ]))),\n    ]),\n    regexp: /[a-z0-9]+/i,\n    date: new Date(\"2023-12-07T17:28:57.909Z\"),\n    map: k,\n    set: m,\n  }),\n  (h[3] = h),\n  k.set(\"self\", k),\n  m.add(m).add(h),\n  (o.self = o),\n  o\n))();\n```\n\n## Docs\n\nThe documentation lives at [seroval.vercel.app](https://seroval.vercel.app).\n\n- [Quick start](https://seroval.vercel.app/docs/quick-start)\n- [Choosing a mode](https://seroval.vercel.app/docs/choosing-a-mode)\n- [Streaming](https://seroval.vercel.app/docs/streaming)\n- [Plugins](https://seroval.vercel.app/docs/using-plugins)\n- [Security](https://seroval.vercel.app/docs/security)\n- [Compatibility](https://seroval.vercel.app/docs/compatibility)\n- [API reference](https://seroval.vercel.app/docs/api)\n- [Playground](https://seroval.vercel.app/playground)\n\n## Sponsors\n\n![Sponsors](https://github.com/lxsmnsyc/sponsors/blob/main/sponsors.svg?raw=true)\n\n## License\n\nMIT © [lxsmnsyc](https://github.com/lxsmnsyc)\n","publish_time":1777876687790,"_cnpm_publish_time":1777876687790,"dist-tags":{"latest":"1.8.1"}}