{"name":"jsonc-simple-parser","description":"A simple JSON parser that supports comments and optional trailing commas.","version":"2.2.1","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"benchmark":"node tasks/benchmark.js","clean":"rimraf dist","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test:test262:init":"git clone https://github.com/tc39/test262.git ./test/test262 && rm ./test/test262/test/built-ins/JSON/parse/name.js","test:test262:prelude":"{ echo 'var module = {}, exports = {};' && esbuild dist/index.js --bundle --format=cjs --minify --target=es2016 && echo 'JSON.parse=module.exports.default.parse;JSON.stringify=module.exports.default.stringify;' } > test/test262/prelude.js","test:test262:execute":"test262-harness -t 8 --prelude ./test/test262/prelude.js ./test/test262/test/built-ins/JSON/parse/*.js ./test/test262/test/built-ins/JSON/stringify/*.js","test:test262":"npm run test:test262:prelude && npm run test:test262:execute","test:lib":"ava","test:lib:watch":"ava --watch","test":"npm run test:test262 && npm run test:lib","prepublishOnly":"npm run clean && npm run compile && npm run test"},"ava":{"files":["test/lib/index.js"]},"bugs":{"url":"https://github.com/fabiospampinato/jsonc-simple-parser/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/jsonc-simple-parser.git"},"keywords":["jsonc","json","comments","trailing commas","commas","parser","parse","stringify","tiny","simple"],"engines":{"node":">=11.0.0"},"dependencies":{"reghex":"^3.0.0"},"devDependencies":{"ava":"^2.4.0","ava-spec":"^1.1.1","benchloop":"^1.3.2","esbuild":"^0.9.3","json5":"^2.2.0","jsonc-parser":"^3.0.0","lodash":"^4.17.21","rimraf":"^3.0.2","test262-harness":"^7.5.2","type-fest":"^0.21.3","typescript":"^4.2.3","typescript-transform-export-interop":"^1.0.2"},"gitHead":"370af65f2ea6c40d5faa060e315e4d289a86f7df","homepage":"https://github.com/fabiospampinato/jsonc-simple-parser#readme","_id":"jsonc-simple-parser@2.2.1","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-cbZ4y7sbz5TiZiPwchLkQvmtqehyp7Xfa4/HluX6Z/EtuIhrw8H5moMx55XWYXx4EJ3A1xyPO3hXtXibzzsCvg==","shasum":"f5a0586792f2ad93f7d563ce27968e9c7fe59c65","tarball":"http://registry-npm.ywwl.com/jsonc-simple-parser/download/jsonc-simple-parser-2.2.1.tgz","fileCount":60,"unpackedSize":363228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOHA/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwBQ//RjCKcDu5kCfheGw5beLgAoAvo+bC+yN+pDw/R6SdRWZxOzV/\r\nANC9z9DnB16/1Nxsjz4VlnOV3EfNjOmF6itb1Qu7NovFQUunHbxK+X9I7f0M\r\nKVDLmVbz3bcdD3+dbkwZGPROSW0Wiz9aOKDfEIpHft7WjR/ukTtjYf+KRFKr\r\nNYnS4nCac3g92eM2CFOhxqX6tD6/pYCctdMfVhnU0DEIeFbKWDjZ6h45xldF\r\nZQ7J1C761l8a1EPHUrqrtpYzWroL2WbB8+wfwihUVu4Tx1XGKC3kkR8a7fo3\r\nI6GJHYYgaIC48YaOUJDVxVV5va9upRN9sFPOzv/tHZD5na604y4CQKBCSWLo\r\nhp8Ji2gXOmlrHQU+qcXwtWXI4pVlujL71XadqtFD6LiM5tz9N1PkUu1qFPoE\r\nlUqCyue2oVokLOSUihyZ64tzoWgf57HAUtIonF+a6EOrGIpuijvRaO+BAFAQ\r\n0qo8mIqDwIQk9By9jbKORhpPH9FCYXm8vSMpuKtoJ4yPkxALRCrK8g5ef9ZY\r\n5jI8HwCFxksNjp4OiWnbO6vWgPABOGkWtktHB4A+zIAY0l8jSPua5fnWty9I\r\nyq9sAv2IYSkyc6Ong3kpXtt5DQ7Px6rFXFH03xQIx5iqXMSt3W9BHY3bY2OG\r\nhhUvyu1cX5+0KV2iSrG/eONtuQP1Ev6tW5I=\r\n=cnAm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDjkkW9IPZOm9kN5SAw5QC5XaLwyxykwKpd3/4va5ybnAiEA/7T4yzN+9yI4EeiKw42914458IOJU/6mXCnB7c7a/d4="}],"size":84485,"noattachment":false,"key":"/jsonc-simple-parser/-/jsonc-simple-parser-2.2.1.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsonc-simple-parser_2.2.1_1647865919712_0.30426116955130467"},"_hasShrinkwrap":false,"readme":"# JSONC Simple Parser\n\nA simple JSON parser that supports comments and optional trailing commas.\n\n## Features\n\n- **Tiny**:\n  - It's ~3.5kb minified and gzipped, if you aren't already using [RegHex](https://github.com/kitten/reghex), otherwise it's just ~2kb.\n  - Even if you aren't using [RegHex](https://github.com/kitten/reghex) already (you should) that's ~32% smaller than VS Code's [jsonc-parser](https://www.npmjs.com/package/jsonc-parser) and ~62% smaller than [JSON5](https://www.npmjs.com/package/json5).\n- **Performant**:\n  - When parsing regular JSON it's ~10x faster than VS Code's [jsonc-parser](https://www.npmjs.com/package/jsonc-parser), ~70x faster than [JSON5](https://www.npmjs.com/package/json5) and just as fast as the native `JSON.parse`.\n  - When parsing JSON with comments or trailing commas it's just as fast as VS Code's [jsonc-parser](https://www.npmjs.com/package/jsonc-parser) and ~6x faster than [JSON5](https://www.npmjs.com/package/json5).\n- **Tested**:\n  - It passes all 274 tests regarding JSON from ECMA's [test262](https://github.com/tc39/test262) test suite.\n  - The parser is obviously not spec compliant but this means that while adding support for comments and trailing commas probably nothing else got broken.\n\n## Install\n\n```sh\nnpm install --save jsonc-simple-parser\n```\n\n## Usage\n\n```ts\nimport JSONC from 'jsonc-simple-parser';\n\nconst source = `\n  { // This is an example\n    \"foo\": 123,\n    /* TRAILING COMMAS */\n    \"bar\": [1, 2, 3,],\n  }\n`;\n\nconst result = {\n  foo: 123,\n  bar: [1, 2, 3]\n};\n\nJSONC.parse ( source ); // => returns an object that's deeply equal to `result`\nJSONC.stringify ( result ); // => same as calling `JSON.stringify`\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1647865919898,"_cnpm_publish_time":1647865919898,"dist-tags":{"latest":"3.0.0"}}