{"_id":"json-bigint-native","_rev":"5-07111e19d49aadc9024adb790c5ffc7f","name":"json-bigint-native","dist-tags":{"latest":"1.2.0"},"versions":{"0.7.0":{"name":"json-bigint-native","version":"0.7.0","description":"JSON.parse with bigints support","main":"index.js","typings":"index.d.ts","scripts":{"test":"./node_modules/mocha/bin/mocha -R spec --check-leaks test/*-test.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/vogievetsky/json-bigint.git"},"keywords":["JSON","bigint","parse","json"],"license":"MIT","devDependencies":{"chai":"4.2.0","mocha":"8.0.1"},"gitHead":"0afc76ed63cae11521f19ba8e11778cf1b33d490","bugs":{"url":"https://github.com/vogievetsky/json-bigint/issues"},"homepage":"https://github.com/vogievetsky/json-bigint#readme","_id":"json-bigint-native@0.7.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BbV5Yk8YEgxqGCBqhUcuDdmpVQ2mxIEBs5JrpmSR+97wRaH4DE3g16toTxZKrEJ3qFe48Vh5UQCLlXCmBgkIQQ==","shasum":"f223fd974502db18f2cf59f7dbf4e52665846b50","tarball":"https://registry.npmjs.org/json-bigint-native/-/json-bigint-native-0.7.0.tgz","fileCount":6,"unpackedSize":36443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfymvSCRA9TVsSAnZWagAAc/kQAINK9XjQhcaDJwkQM5eP\nlp6sTR72OfjmKiFXcOmyZSET2/beJIYwLzZTbG41FU/gZ5JQETGp5aJZu2Gt\nnXTb7glDJcGkA6oGSDgE/ohpDrtJYnRo02JSzi2UG0fxi+bZwx8CepEe6Eee\ncxfPN1uJOtX/gilhqcmLg4j6W/r8T/UfucJqy5afUFLhQqhZTjvVj9kZt2IR\njRtY0wym+dI4xSvY+tSHxmP3w0ep1eHjHkVirQ2IFj3ydN+fsVqJ394dZr9k\njG6DiABsFziK98tIP829PnkCnjr6Fo2WQs2fI00nFvsrEsi3cRfyF6IhE8I4\nlKZymo9phvyHg4VP895lGiICtcSgkuz3sEiKAez6v93Gs5Z0PfvKm2SaJXzJ\nRDyzCEb0wyUuXxEhGmlqbybFZKFRS4b/5qtlIUdeQMyuwboodtJprvc9kJrn\n4Xg48T3w2c0/CiClkI1Kmjj3jJc1EBYmArfwcIf1lliJPUHxmU+dbrzXXGXO\nIoTOmMlVf4AADjH/2UT4jmFJGveBcLH1Rz5DjGq1zXn82I30ju0esAqlJyfv\nhkAli1EeUlXmvflkF+T1JfxN1kmP7x4XehNugUDrMwjdRWilf1P1mXBRYVfO\nupUu6mM7PEWMTk22hq82G9naMtpUfZvoTiCvHQy7I37Ts0IXW/iavWXHAG09\nIe9r\r\n=BBT9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFBAhOJijgVoIPX+wpvIWZMLAbsb17kfpCFK+yeH8bkQAiB7gF+39L/4ClWbmVd9hJW2UWCCRh+nWI/oI8hYESXffg=="}]},"_npmUser":{"name":"vadimon","email":"vadim@imply.io"},"directories":{},"maintainers":[{"name":"vadimon","email":"vadim@imply.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-bigint-native_0.7.0_1607101394351_0.29083022779772105"},"_hasShrinkwrap":false},"0.8.0":{"name":"json-bigint-native","version":"0.8.0","description":"JSON.parse with bigints support","main":"index.js","typings":"index.d.ts","scripts":{"test":"./node_modules/mocha/bin/mocha -R spec --check-leaks test/*-test.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/vogievetsky/json-bigint.git"},"keywords":["JSON","bigint","parse","json"],"license":"MIT","devDependencies":{"chai":"4.2.0","mocha":"8.0.1"},"gitHead":"41e2ac08a86733e0eb72f7b886076ebe3d08b779","bugs":{"url":"https://github.com/vogievetsky/json-bigint/issues"},"homepage":"https://github.com/vogievetsky/json-bigint#readme","_id":"json-bigint-native@0.8.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-OjsAN/fdNetXrx5kKcrayUIP/Dh8GOFAo/J6Fqp2uBXB4k5VRebJwkDYv3ttJjhC+6zxcgCJE7pwZeeEZ1eHew==","shasum":"64dc6175f9710dc8831d5020e91b168f831bd1cd","tarball":"https://registry.npmjs.org/json-bigint-native/-/json-bigint-native-0.8.0.tgz","fileCount":7,"unpackedSize":35567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyoRACRA9TVsSAnZWagAAx14QAJlcmysQBBNbIvdabf+V\nmGcuRh5gqD574bFVYVoYY3e9Y78TqM7+gX5Be3Dy7pkNCYtLwPSQHyFh9WAa\nSEgjeOeyx4xwStU7wZ2ajtwG5Q2tWuAiHaBkwPWDUrqGLDkqyavbNeliH6EJ\nIBMVFQkLzo0nT0DbPJ4jP8CaClosQdI+qq6d7zUFMNbxp3Te5UtEPNh4w7gJ\nmil5ur5VeKeTV0Ak6CcMYeF0PTWBpPhRsdYO3H+u43KOwhZcrmPfTNKrXi5p\nXLvB8qDKd0FXx6GpY/+JGbEG6yzn3EiOS2gGMgl/C3H/pK8A/tBOP6DfJvBT\nuYSOm4zUoXX51nqqejxDZJLJiRhTGtHzB47iYyIpJNu6iTSBUzExjwXjWiDf\nZnfnKeiEgSIlD3US73QD4oieuZ0UNeVjreHl6T98AvH1p9hK622MJLsHR/3e\nKf/J/4gcu4ShH8qQ2BQ2mx3uLDaxBvYbCHZsU6nrSQgjc0HHvI5frhnpGJJM\nL+IyUno3AB6F3D/5yJL47rGv/5PgwApKmB8q3YXuR6r3HmdB5oKLYmuYJOIp\no5gMqHPFP50hfiMchUtz4a1Cj9lMgMJzrGW9711wIN3zGdKEA3x0IhTufavy\nISLfqrwwaWTyj4Is2dU2WvV5VB5B+hVGL+IIsNP/aKJx+naWjFlcDuLRct7O\nofqw\r\n=+Xzq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaPZRTGjSraBb22sMtdYMEPuBtRh1zN0JhP50h0ZUkEQIhAN+JArN7/GkmMq5UhadrFB5b08p3vZFM0hVPRuUKIhUQ"}]},"_npmUser":{"name":"vadimon","email":"vadim@imply.io"},"directories":{},"maintainers":[{"name":"vadimon","email":"vadim@imply.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-bigint-native_0.8.0_1607107647832_0.7107077148366097"},"_hasShrinkwrap":false},"1.0.0":{"name":"json-bigint-native","version":"1.0.0","description":"JSON.parse with bigints support","main":"index.js","typings":"index.d.ts","scripts":{"test":"./node_modules/mocha/bin/mocha -R spec --check-leaks test/*-test.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/vogievetsky/json-bigint.git"},"keywords":["JSON","bigint","parse","json"],"license":"MIT","devDependencies":{"chai":"4.2.0","mocha":"8.0.1"},"gitHead":"d44fb5c9f7f607d8836e69bba49f9e94c5040c32","bugs":{"url":"https://github.com/vogievetsky/json-bigint/issues"},"homepage":"https://github.com/vogievetsky/json-bigint#readme","_id":"json-bigint-native@1.0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-upUMnqV96WRGAbopHwDFHxsJbdBZRAdZW3WEJTB/WMLUseDEhJkcOQ0qr5x+JOHwIWpI9BYc6zoVJkmbL7SMLA==","shasum":"1d513f214394d4a8ea539576f79339281002a71d","tarball":"https://registry.npmjs.org/json-bigint-native/-/json-bigint-native-1.0.0.tgz","fileCount":7,"unpackedSize":35561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfytIiCRA9TVsSAnZWagAA0LIP/RXrQt4F1JSvP5uaYYHO\npeVlfpzWfhP37iFp79tpa2qJFx7KCjH86Udqv2XqnoWd9RTTac/7+4TVRxQe\nyELFhwKKpuLW6MD3dOhwVWiLzz0zJgzVM9WhFlMBBe3ckuZ+OD7jTQIuPA4u\n5Mrzgf0LtdAIqPFw7dh+K4mOhxrAg83G6FFx/NlNvqRWheKyb2BP1z17ojlj\nM+xIFPjdWI4iHLy3MXJlBJqMW5puIa8DA9Ma8O/7tL05yNQY+u+IDQa6LWLw\npIcAtq1LyT/HzsstI103Se6HeBGAM1mFRaoknxlmztfLvOKR6Gatyo3oMjw9\nKxQE/Y+FxOALHKlHzT++t95vLIC5q1HQ8HrmxNlMzhKeuNYPFXd67d6PFS5L\nh5aa7VagdPqiRzLQ5H6pk/dGq4c5vkWREiFh1LFZTpcO1ERaizvD0Y62lTy/\ncYCvdvaY2z+ID+gptMfCo1kLljuDJg7xG+eOdkKIJLGDxqNPYIi+ghGq7J7/\nWNP+zqOlqRbi5h4W/o2xUdTnKOyEXnMyo0eqWz6W3JCB2Gq4j6n5r8h8Cb4/\nxAtbRVV7tCBegMWerex0HYc71AhLoX4xgHybGnwy1igsRPDFI/KdcjZiMo0A\nPnJbHy3HmemXpnZhgNoDZWuJo7VCw2Rhzh3gNDluzwfGzja1/PLlfnIll3hx\nDOky\r\n=1HvE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNO896Kbib9BKaX+nKvgSaBMjOX+H2tHFMD8JDxod0JwIgFnNQoBzxeK0mQnnuLEuuZaHG+etdsGxHTZkvrwqNuak="}]},"_npmUser":{"name":"vadimon","email":"vadim@imply.io"},"directories":{},"maintainers":[{"name":"vadimon","email":"vadim@imply.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-bigint-native_1.0.0_1607127586282_0.9047554225483041"},"_hasShrinkwrap":false},"1.1.0":{"name":"json-bigint-native","version":"1.1.0","description":"JSON.parse with bigints support","main":"index.js","typings":"index.d.ts","scripts":{"test":"./node_modules/mocha/bin/mocha -R spec --check-leaks test/*-test.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/vogievetsky/json-bigint.git"},"keywords":["JSON","bigint","parse","json"],"license":"MIT","devDependencies":{"chai":"4.2.0","mocha":"8.0.1"},"gitHead":"9b65ace92715ff5304ab376f46bd20f99ddb24e7","bugs":{"url":"https://github.com/vogievetsky/json-bigint/issues"},"homepage":"https://github.com/vogievetsky/json-bigint#readme","_id":"json-bigint-native@1.1.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PPL9AlDP0ift5v8siEsR7oQsamOAIOLjn14GRaijZRUWDXsJC5rHXNlmtLPkPjK0k2i5yHK30VPqiFTZHolXaA==","shasum":"9f09f8b1e944af91fa0c5d10a8fa16c750f9def2","tarball":"https://registry.npmjs.org/json-bigint-native/-/json-bigint-native-1.1.0.tgz","fileCount":7,"unpackedSize":35623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+5dbCRA9TVsSAnZWagAA2toP/Rohmp2ts4xMD1bhFKNL\nMF2WrLeizjczOBSraAkx1OUdaOxpExZE/5K+BbeZPqjiHRSUMP/WNeFgqMPm\nuzlnZjbM3DWrr+C3OTUz/80GQrkaSmsImXM8YWLgrwZ1gdutNTacMXtOm3Ws\nIbyCBpEPjeWmuWP4IddaAiU6SHkSbnG8iTGLrOQLlttVBHL+OyKUpUQPexS1\n23OxDfxFhl05F57sPVda1QfdKkA1olzatT/ryAasvfmfMSLXw51X6uq26jGf\n2ccqLr/5BV/GPvjQ2n1aLYZm1pALRlnfXucHS7tcmlPrOwVJLZg7SwGFDO+V\n/DXD+3Ye5jSTdbcbDdUj47xwRVcH4kiYlFkF4/oD3osFS/OcEEOUnIfMl/4y\nmfKF9UyGS9RSLmVyRuVkQGah1rwK5s+UE3HX6493h3syla74vyrsNrp93c3M\n20dyofZl2TkwjjBdz8bvit89Q8PiOyPptPD0beDlx1z16ZdkKD/FM2J2Ikvg\nb/rRLbIbxkbs0Rof38CSYzjKPOlJJncVDk/0c8eLJhaKDTJppnW0KVa/WtWh\nHT1415UeWOzZiobgc/vC1fOI1R3abkA/d4xpumuAULIWo9+ljRBPerXMMEqN\nKHeCYoUi/5Y5d4RHJDJ4PzAiDTrx9CXPE1AVTZN4gDPyOwyc47P4vSEi4oWD\n21PR\r\n=8qKw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBSvC6gkqAlF0SNX1ZgKXKxHyM63/SmWBno8QsmMJodSAiA545C/d6H6rGGrN9CLYjOMA7pMp3uv52M9pJVDpQ2jZw=="}]},"_npmUser":{"name":"vadimon","email":"vadim@imply.io"},"directories":{},"maintainers":[{"name":"vadimon","email":"vadim@imply.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-bigint-native_1.1.0_1610323802653_0.9988008975390303"},"_hasShrinkwrap":false},"1.2.0":{"name":"json-bigint-native","version":"1.2.0","description":"JSON.parse with bigints support","main":"index.js","typings":"index.d.ts","scripts":{"test":"./node_modules/mocha/bin/mocha -R spec --check-leaks test/*-test.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/vogievetsky/json-bigint.git"},"keywords":["JSON","bigint","parse","json"],"license":"MIT","devDependencies":{"chai":"4.2.0","mocha":"8.0.1"},"gitHead":"2e2684eea78cf2eba977a1333216835cafba2ace","bugs":{"url":"https://github.com/vogievetsky/json-bigint/issues"},"homepage":"https://github.com/vogievetsky/json-bigint#readme","_id":"json-bigint-native@1.2.0","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-qC9EtJsyULhbwC2KEYoR8sRsC+PH7VwwPdxU6+CZTZxMtM23zlxCfhIa+6Sn74FQ4VqDqWUaHaBeU0bMUTU9jQ==","shasum":"69c05d5681989cdeb29c709f77962d9ed2523e9d","tarball":"https://registry.npmjs.org/json-bigint-native/-/json-bigint-native-1.2.0.tgz","fileCount":7,"unpackedSize":32512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+W4hCRA9TVsSAnZWagAAz1IQAJAyKXoBnxtPISf/dC3Y\nqIVtdbbF1ThYcP5YhMOtLEtM43tkoFZwzeUFG/DW8NM2bpf+9QLSutFlvDRK\nMmbFLM540mv5NG+BcgJtPXUBODDDG8qwy9SRtGywHTedawD2fOgJiiU+gHvO\ny/6Q67tQdEbo/pwOSz4bDFJlEmcFFfsVdbU594wBKaVYv9ih+8jtdkwB6Xjj\nIsNo8dCQmtXIckbM4dwo0h9lBFlg0yOV2bLyhWaJYUS7WlGE0FNUQNhqL7uV\nWo8AdytGmGFbMuA34kEPYJ5cNzKMDdfKQuWCPevEhkLSvTJSC5JFuIXN+GsZ\ngCM4CAhXDFlzc51ACxxdBXPFWesZkkNAVWtVgn40HThHKfTBMHvNEgNvS7Zd\nAwfoOD6T36iZgi0qm7NkT9p6jZ0PScvEoJQlyU3hzn5yiq0w9bTtGUfzp6dL\nL91su34zrugvA1JSmhvCXZrG7L5AJEeCyi8wKg5ulxjgPBztU4uUF0OQibT5\nJqmLZhQVDJLmZGcukrjKxtZQ5IUxprkNf2rfFrFOi06oEV6zUEQ9dUpTGY64\nSuAryd66Hvp8uc4SVbDwu7XH3isS69BcAT2PtCOOT0LRSc+T0kn2O3CHAg0W\nW6QqkMxZ7iT4UAc/+E1/PzQi/0F6l1EFAfJ266rHEe76WKRJcKPVG+9/Nb6J\nmLSa\r\n=txyK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmOINFr3vYvNs7r/K2svW/6znXj0rzPmIbOcMi9BsMfQIhAN8yoHhryJ7D6GcW8doKFLcXjPopqgd9plBUcQQuN7hM"}]},"_npmUser":{"name":"vadimon","email":"vadim@imply.io"},"directories":{},"maintainers":[{"name":"vadimon","email":"vadim@imply.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-bigint-native_1.2.0_1643736609230_0.007836579242925135"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-04T17:03:14.351Z","0.7.0":"2020-12-04T17:03:14.498Z","modified":"2022-05-06T21:24:35.805Z","0.8.0":"2020-12-04T18:47:27.966Z","1.0.0":"2020-12-05T00:19:46.417Z","1.1.0":"2021-01-11T00:10:02.774Z","1.2.0":"2022-02-01T17:30:09.441Z"},"maintainers":[{"name":"vadimon","email":"vadim@imply.io"}],"description":"JSON.parse with bigints support","homepage":"https://github.com/vogievetsky/json-bigint#readme","keywords":["JSON","bigint","parse","json"],"repository":{"type":"git","url":"git+ssh://git@github.com/vogievetsky/json-bigint.git"},"bugs":{"url":"https://github.com/vogievetsky/json-bigint/issues"},"license":"MIT","readme":"# json-bigint-native\n\nThis is a fork of https://github.com/sidorares/json-bigint (at version 1.0.0) but without bignumber.js, only BigInt with a number of other (breaking) changes.\n\nOther changes from sidorares/json-bigint:\n\n- Remove `bignumber.js` dependency\n- Remove `useNativeBigInt` option (it is always `true`)\n- Remove `protoAction` and `constructorAction`, use `Object.defineProperty` for safety instead\n- Removed `alwaysParseAsBig` option\n- Moved all the options to the 3rd argument of parse\n- Fixed parsing of long floats\n- Added TypeScript types\n- Removed `storeAsString` option\n- Added `fallbackTo` option `number`, `string`, `error`\n\nThe rest is edited from the original.\n\nJSON.parse/stringify with bigints support. Based on Douglas Crockford [JSON.js](https://github.com/douglascrockford/JSON-js) package and BigInt.\n\nWhile most JSON parsers assume numeric values have same precision restrictions as IEEE 754 double, JSON specification _does not_ say anything about number precision. Any floating point number in decimal (optionally scientific) notation is valid JSON value. It's a good idea to serialize values which might fall out of IEEE 754 integer precision as strings in your JSON api, but `{ \"value\" : 9223372036854775807}`, for example, is still a valid RFC4627 JSON string, and in most JS runtimes the result of `JSON.parse` is this object: `{ value: 9223372036854776000 }`\n\n==========\n\nexample:\n\n```js\nvar JSONbig = require('json-bigint-native');\n\nvar json = '{ \"value\" : 9223372036854775807, \"v2\": 123 }';\nconsole.log('Input:', json);\nconsole.log('');\n\nconsole.log('node.js built-in JSON:');\nvar r = JSON.parse(json);\nconsole.log('JSON.parse(input).value : ', r.value.toString());\nconsole.log('JSON.stringify(JSON.parse(input)):', JSON.stringify(r));\n\nconsole.log('\\n\\nbig number JSON:');\nvar r1 = JSONbig.parse(json);\nconsole.log('JSONbig.parse(input).value : ', r1.value.toString());\nconsole.log('JSONbig.stringify(JSONbig.parse(input)):', JSONbig.stringify(r1));\n```\n\nOutput:\n\n```\nInput: { \"value\" : 9223372036854775807, \"v2\": 123 }\n\nnode.js built-in JSON:\nJSON.parse(input).value :  9223372036854776000\nJSON.stringify(JSON.parse(input)): {\"value\":9223372036854776000,\"v2\":123}\n\n\nbig number JSON:\nJSONbig.parse(input).value :  9223372036854775807\nJSONbig.stringify(JSONbig.parse(input)): {\"value\":9223372036854775807,\"v2\":123}\n```\n\n### Options\n\nThe behaviour of the parser is somewhat configurable through 'options'\n\n#### options.strict, boolean, default false\n\nSpecifies the parsing should be \"strict\" towards reporting duplicate-keys in the parsed string.\nThe default follows what is allowed in standard json and resembles the behavior of JSON.parse, but overwrites any previous values with the last one assigned to the duplicate-key.\n\nSetting options.strict = true will fail-fast on such duplicate-key occurances and thus warn you upfront of possible lost information.\n\nexample:\n\n```js\nvar JSONbig = require('json-bigint-native');\n\nvar dupkeys = '{ \"dupkey\": \"value 1\", \"dupkey\": \"value 2\"}';\nconsole.log('\\n\\nDuplicate Key test with both lenient and strict JSON parsing');\nconsole.log('Input:', dupkeys);\nvar works = JSONbig.parse(dupkeys);\nconsole.log('JSON.parse(dupkeys).dupkey: %s', works.dupkey);\nvar fails = 'will stay like this';\ntry {\n  fails = JSONbig.parse(dupkeys, undfined, { strict: true });\n  console.log('ERROR!! Should never get here');\n} catch (e) {\n  console.log(\n    'Succesfully catched expected exception on duplicate keys: %j',\n    e\n  );\n}\n```\n\nOutput\n\n```\nDuplicate Key test with big number JSON\nInput: { \"dupkey\": \"value 1\", \"dupkey\": \"value 2\"}\nJSON.parse(dupkeys).dupkey: value 2\nSuccesfully catched expected exception on duplicate keys: {\"name\":\"SyntaxError\",\"message\":\"Duplicate key \\\"dupkey\\\"\",\"at\":33,\"text\":\"{ \\\"dupkey\\\": \\\"value 1\\\", \\\"dupkey\\\": \\\"value 2\\\"}\"}\n\n```\n\n#### options.storeAsString, enum, default false\n\nSpecifies if BigInts should be stored in the object as a string, rather than the default BigNumber.\n\nNote that this is a dangerous behavior as it breaks the default functionality of being able to convert back-and-forth without data type changes (as this will convert all BigInts to be-and-stay strings).\n\nexample:\n\n```js\nvar JSONbig = require('json-bigint-native');\nvar JSONbigString = require('json-bigint-native')({ storeAsString: true });\nvar key = '{ \"key\": 1234567890123456789 }';\nconsole.log('\\n\\nStoring the BigInt as a string, instead of a BigNumber');\nconsole.log('Input:', key);\nvar withInt = JSONbig.parse(key);\nvar withString = JSONbigString.parse(key);\nconsole.log(\n  'Default type: %s, With option type: %s',\n  typeof withInt.key,\n  typeof withString.key\n);\n```\n\nOutput\n\n```\nStoring the BigInt as a string, instead of a BigNumber\nInput: { \"key\": 1234567890123456789 }\nDefault type: object, With option type: string\n\n```\n\n### Links:\n\n- [RFC4627: The application/json Media Type for JavaScript Object Notation (JSON)](http://www.ietf.org/rfc/rfc4627.txt)\n- [Re: \\[Json\\] Limitations on number size?](http://www.ietf.org/mail-archive/web/json/current/msg00297.html)\n- [Is there any proper way to parse JSON with large numbers? (long, bigint, int64)](http://stackoverflow.com/questions/18755125/node-js-is-there-any-proper-way-to-parse-json-with-large-numbers-long-bigint)\n- [What is JavaScript's Max Int? What's the highest Integer value a Number can go to without losing precision?](http://stackoverflow.com/questions/307179/what-is-javascripts-max-int-whats-the-highest-integer-value-a-number-can-go-t)\n- [Large numbers erroneously rounded in Javascript](http://stackoverflow.com/questions/1379934/large-numbers-erroneously-rounded-in-javascript)\n\n### Note on native BigInt support\n\n#### Stringifying\n\nFull support out-of-the-box, stringifies BigInts as pure numbers (no quotes, no `n`)\n\n#### Limitations\n\n- Roundtrip operations\n\n`s === JSONbig.stringify(JSONbig.parse(s))` but\n\n`o !== JSONbig.parse(JSONbig.stringify(o))`\n\nwhen `o` has a value with something like `123n`.\n\n`JSONbig` stringify `123n` as `123`, which becomes `number` (aka `123` not `123n`) by default when being reparsed.\n\nThere is currently no consistent way to deal with this issue, so we decided to leave it, handling this specific case is then up to users.\n","readmeFilename":"README.md"}