{"name":"jsonc-simple-parser","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/jsonc-simple-parser.git"},"description":"A simple JSON parser that supports comments and optional trailing commas.","version":"3.0.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --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":"fava '**/test/lib/*'","test:lib:watch":"fava --watch '**/test/lib/*'","test":"npm run test:test262 && npm run test:lib","prepublishOnly":"npm run clean && npm run compile && npm run test"},"keywords":["jsonc","json","comments","trailing commas","commas","parser","parse","stringify","tiny","simple"],"dependencies":{"reghex":"^3.0.2"},"devDependencies":{"fava":"^0.0.6","benchloop":"^1.3.2","esbuild":"^0.15.13","json5":"^2.2.1","jsonc-parser":"^3.2.0","lodash":"^4.17.21","test262-harness":"^7.5.2","type-fest":"^3.2.0","tsex":"^1.1.2","typescript":"^4.8.4"},"gitHead":"4e888a4b45064030632d35c1292634e772e0e11c","bugs":{"url":"https://github.com/fabiospampinato/jsonc-simple-parser/issues"},"homepage":"https://github.com/fabiospampinato/jsonc-simple-parser#readme","_id":"jsonc-simple-parser@3.0.0","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-0qi9Kuj4JPar4/3b9wZteuPZrTeFzXsQyOZj7hksnReCZN3Vr17Doz7w/i3E9XH7vRkVTHhHES+r1h97I+hfww==","shasum":"7765167bc7c012c9977c4379a048559a0447f2e8","tarball":"http://registry-npm.ywwl.com/jsonc-simple-parser/download/jsonc-simple-parser-3.0.0.tgz","fileCount":60,"unpackedSize":359890,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/gVdHO4At2s8mG7cbKFsYvmkEZtvko3O61BQ/qiLOCgIhAOQd2wQStSQLSHL9Xz92MnLzcBRDVUMcv3faMW+K7y9/"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja74mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJ4w/+NHMWyhXMo4ZhuwVA7LHjeKRW4OV5TZAxz4TlMSHAL2ynsCKi\r\ncS7YSzGG/u+lTdEeIT9P9QsloICs1FThkoBu/BTA6CectDkTKhuKVRJp+UN+\r\n02zMqhKFxLDi9Lz096CZyaXbCpvntGHzUoqbpV9BtiBP+KG1VQ+V4zJ3C5XV\r\nduf6OBkdUBw9fSISSRU1NH9AhBtOZRPiWZqOvFSYbiPSdW/IPu8y7NpS660H\r\nEPDvD8Ecok4W/13S+63me9iWW5QIppq3+t5KuXMoNoBqI6071DzgngVWbZmJ\r\nuYSy9tfT3rU5Ca1a5SFgJEuARGteK6ANwmrFfdmuCmI1grqPbqnFWvIncGRu\r\nPekAexH1vHilhRU4LZmJkG0dCHsxBR+/GwxHCSfdPhx0fpVBD7ccMms3gNxU\r\npbGIfG6rl+jG2nWJVdy/UGBzNnvX3YafkbEK4kXp2DE4py4ACPClUJfsfgiI\r\nIRjFWxi9gLh0aMccOFVPvjrkCxKhD6QRvGWMOHCjRpcPASySScZJQ8ayKoeZ\r\nnKMNBniAoWNZVO5r1oqw3G/wCWxOgJgzoQwSN9fOsUtsHSAgpIvL+TWuhTPQ\r\nrhTQtsFckhfNxiCwC3u7ePhEnpVaNIBKsDxDqJHMdhommJRtgZA2CSqbnAQd\r\nrsO8Ks1/gbtrPnytyqPh3WsAfIQEdpad0yw=\r\n=EF3r\r\n-----END PGP SIGNATURE-----\r\n","size":83625,"noattachment":false,"key":"/jsonc-simple-parser/-/jsonc-simple-parser-3.0.0.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_3.0.0_1668005413964_0.04701029559721226"},"_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":1668005414247,"_cnpm_publish_time":1668005414247,"dist-tags":{"latest":"3.0.0"}}