{"name":"seroval","type":"module","version":"0.4.0-alpha.10","engines":{"node":">=10"},"license":"MIT","keywords":["pridepack"],"devDependencies":{"@types/node":"^18.11.18","eslint":"^8.32.0","eslint-config-lxsmnsyc":"^0.4.8","pridepack":"2.4.0","tslib":"^2.4.1","typescript":"^4.9.4","vitest":"^0.28.1"},"scripts":{"prepublishOnly":"pridepack clean && pridepack build","build":"pridepack build","type-check":"pridepack check","lint":"pridepack lint","clean":"pridepack clean","watch":"pridepack watch","start":"pridepack start","dev":"pridepack dev","test":"vitest"},"private":false,"description":"Stringify JS values","repository":{"url":"git+https://github.com/lxsmnsyc/seroval.git","type":"git"},"homepage":"https://github.com/lxsmnsyc/seroval/tree/main/packages/seroval","bugs":{"url":"https://github.com/lxsmnsyc/seroval/issues"},"publishConfig":{"access":"public"},"author":{"name":"Alexis Munsayac"},"types":"./dist/types/index.d.ts","main":"./dist/cjs/production/index.cjs","module":"./dist/esm/production/index.mjs","exports":{".":{"development":{"require":"./dist/cjs/development/index.cjs","import":"./dist/esm/development/index.mjs"},"require":"./dist/cjs/production/index.cjs","import":"./dist/esm/production/index.mjs","types":"./dist/types/index.d.ts"}},"typesVersions":{"*":{}},"gitHead":"8b6be3d5d8a6860e0e5d0717b973fee5c94e07fb","_id":"seroval@0.4.0-alpha.10","_nodeVersion":"19.6.0","_npmVersion":"lerna/6.4.1/node@v19.6.0+x64 (win32)","dist":{"integrity":"sha512-icJf9EKVHg3NN4kAmE65PmbcILrUhDEQpU7Xn7uTJRhz6+fZOmoY/6V29aJDttxUMOw4tMvaUjrs3667rDTBxw==","shasum":"84302562a8f21b0131ef2b088645938186911e4b","tarball":"http://registry-npm.ywwl.com/seroval/download/seroval-0.4.0-alpha.10.tgz","fileCount":36,"unpackedSize":403163,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGU9zIGfozMMmNUbDG0WqXg7ksLchoaGi2GZtuqbNJRbAiA1AtDiOLC2XUTnVld0296yKrw1RFG18F9GqWeRUO8ZTg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEZL1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3Hg/7BZyS6vpkN7yeJWbY6nXbjcZ8MpTwZdkjNF8qSUD03b0+KixB\r\nTfFa27WFQlDJlTnxELc/6hRrtM3tRY8e5GcpNGSm0939OX/yITXg1dZ5Y2K1\r\nHMvSgwS6pSt0RCsvOKuEquh5J0LTt9tjW8FG8HmBhTpmKZXDUz7fL0Wu9ClC\r\nGWANwStgAvi+XbIWNFKQJkA+nUswYRQXgypgtK0wATr3+waGJP8GIFUwmxP6\r\n/iH75oSlH8bfZ8+UQvOcqTnsSq/4eSjicNqTFvLqfM5H6rDC6MSpr9758KOE\r\nyRdNjIM/t7X1nHeu2JcuBcQkKFxvKjavoyQwnLA81uk2gjQmJ3e7JisWMCTf\r\nLVgHUHopXqmtBNtuMd63h5qTa3McXCBhLNv51PXPy11H4XTvcNQkahaMyS5J\r\n8Zj3GuIlmrSm3dWnT+PpTBHbpeX/OPHC6Pgo6wyFwo1jfisHko0qy37u5CjH\r\nOWBRIz5Y+AZ8erNxVLNfY98h3R21eQ5GByBR0gQAh6zYBOrfGpUoPFmDLF8f\r\nKKNc8/9xEfkXl3rRUEDcO5kIF6y120oK0xCuQYvuBkd8boIzj+dK5OjriIM8\r\nhH6SOGFAdQ1vWhJ26j9XaaF1mxAt0xwOuMiJ7EyxfBoaRe8BNvS6avtraWSj\r\noIp5EWNneoMRwyssUVcWnHhoFcQjA6xAnSY=\r\n=MoHz\r\n-----END PGP SIGNATURE-----\r\n","size":76979,"noattachment":false,"key":"/seroval/-/seroval-0.4.0-alpha.10.tgz"},"_npmUser":{"name":"lxsmnsyc","email":"alexis.munsayac@gmail.com"},"directories":{},"maintainers":[{"name":"lxsmnsyc","email":"alexis.munsayac@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/seroval_0.4.0-alpha.10_1678873332959_0.4406968602352497"},"_hasShrinkwrap":false,"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\n- [Serialization](https://github.com/lxsmnsyc/seroval/blob/main/docs/serialization.md)\n- [Compatibility](https://github.com/lxsmnsyc/seroval/blob/main/docs/compatibility.md)\n- [Isomorphic References](https://github.com/lxsmnsyc/seroval/blob/main/docs/isomorphic-refs.md)\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":1678873333123,"_cnpm_publish_time":1678873333123,"dist-tags":{"latest":"1.8.1"}}