strip-json-comments
Last updated
Was this helpful?
Last updated
Was this helpful?
Strip comments from JSON. Lets you use comments in your JSON files!
This is now possible:
It 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.
Also available as a // plugin.
Type: string
Accepts a string with JSON and returns a string without comments.
Type: object
whitespace
Type: boolean
Default: true
Replace comments with whitespace instead of stripping them entirely.
- CLI for this module
- Strip comments from CSS
Tidelift helps make open source sustainable for maintainers while giving companies assurances about security, maintenance, and licensing for their dependencies.