{"name":"strip-json-comments","version":"5.0.2","keywords":["json","strip","comments","remove","delete","trim","multiline","parse","config","configuration","settings","util","env","environment","jsonc"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"strip-json-comments@5.0.2","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/strip-json-comments#readme","bugs":{"url":"https://github.com/sindresorhus/strip-json-comments/issues"},"xo":{"rules":{"complexity":"off"}},"dist":{"shasum":"14a76abd63b84a6d2419d14f26a0281d0cf6ea46","tarball":"http://registry-npm.ywwl.com/strip-json-comments/download/strip-json-comments-5.0.2.tgz","fileCount":5,"integrity":"sha512-4X2FR3UwhNUE9G49aIsJW5hRRR3GXGTBTZRMfv568O60ojM8HcWjV/VxAxCDW3SUND33O6ZY66ZuRcdkj73q2g==","signatures":[{"sig":"MEYCIQCk7tU66Y9u4PZNoL7BzZQs70gA9VSBw2777h8si8Pf/gIhAOpdRaRhje9tlvoWNxgzQanJZxnJHD8ky3t6Zr6yQMK3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8153,"size":2992,"noattachment":false,"key":"/strip-json-comments/-/strip-json-comments-5.0.2.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=14.16"},"exports":"./index.js","funding":"https://github.com/sponsors/sindresorhus","gitHead":"ba1182cbeae33349b8f8d6094d34772d631ac7d4","scripts":{"test":"xo && ava && tsd","bench":"matcha benchmark.js"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/strip-json-comments.git","type":"git"},"_npmVersion":"10.9.2","description":"Strip comments from JSON. Lets you use comments in your JSON files!","directories":{},"sideEffects":false,"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.54.2","ava":"^4.3.1","tsd":"^0.22.0","matcha":"^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/strip-json-comments_5.0.2_1747428441524_0.16247267779995456","host":"s3://npm-registry-packages-npm-production"},"readme":"# strip-json-comments\n\n> Strip comments from JSON. Lets you use comments in your JSON files!\n\nThis is now possible:\n\n```js\n{\n\t// Rainbows\n\t\"unicorn\": /* ❤ */ \"cake\"\n}\n```\n\nIt will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.\n\nAlso available as a [Gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[Grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[Broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin.\n\n## Install\n\n```sh\nnpm install strip-json-comments\n```\n\n## Usage\n\n```js\nimport stripJsonComments from 'strip-json-comments';\n\nconst json = `{\n\t// Rainbows\n\t\"unicorn\": /* ❤ */ \"cake\"\n}`;\n\nJSON.parse(stripJsonComments(json));\n//=> {unicorn: 'cake'}\n```\n\n## API\n\n### stripJsonComments(jsonString, options?)\n\n#### jsonString\n\nType: `string`\n\nAccepts a string with JSON and returns a string without comments.\n\n#### options\n\nType: `object`\n\n##### trailingCommas\n\nType: `boolean`\\\nDefault: `false`\n\nStrip trailing commas in addition to comments.\n\n##### whitespace\n\nType: `boolean`\\\nDefault: `true`\n\nReplace comments and trailing commas with whitespace instead of stripping them entirely.\n\n## Benchmark\n\n```sh\nnpm run bench\n```\n\n## Related\n\n- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module\n- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS\n","publish_time":1747428441731,"_cnpm_publish_time":1747428441731,"dist-tags":{"latest":"5.1.0"}}