{"name":"strip-json-comments","version":"5.0.3","description":"Strip comments from JSON. Lets you use comments in your JSON files!","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-json-comments.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd","bench":"matcha benchmark.js"},"keywords":["json","strip","comments","remove","delete","trim","multiline","parse","config","configuration","settings","util","env","environment","jsonc"],"devDependencies":{"ava":"^4.3.1","matcha":"^0.7.0","tsd":"^0.22.0","xo":"^0.54.2"},"xo":{"rules":{"complexity":"off"}},"_id":"strip-json-comments@5.0.3","gitHead":"7355ba42e0ad6e5cd27cc984add85355df50fa34","bugs":{"url":"https://github.com/sindresorhus/strip-json-comments/issues"},"homepage":"https://github.com/sindresorhus/strip-json-comments#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==","shasum":"b7304249dd402ee67fd518ada993ab3593458bcf","tarball":"http://registry-npm.ywwl.com/strip-json-comments/download/strip-json-comments-5.0.3.tgz","fileCount":5,"unpackedSize":8200,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDcVQqNGwGM4F9Bo5MsfcFN/+HpEtrXUPD787GcNO4ckAiANu7m+9YrIRQ3X1Ki3NoOe2oSEQo1sU3aB9AQ98yV5rw=="}],"size":3004,"noattachment":false,"key":"/strip-json-comments/-/strip-json-comments-5.0.3.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/strip-json-comments_5.0.3_1754662444880_0.42329154462048413"},"_hasShrinkwrap":false,"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":1754662445044,"_cnpm_publish_time":1754662445044,"dist-tags":{"latest":"5.1.0"}}