1.安装strip-json-comment
$ npm install --global strip-json-comments-cli
2.使用说明
Usage
$ strip-json-comments --help
Usage
$ strip-json-comments <input-file> > <output-file>
$ strip-json-comments < <input-string>
Options
--no-whitespace Remove comments instead of replacing them with whitespace
Example
$ strip-json-comments input.json > output.json
3.使用示例
strip-json-comments input.json > output.json
https://github.com/sindresorhus/strip-json-comments-cli
https://github.com/sindresorhus/strip-json-comments
原文:https://www.cnblogs.com/tomtellyou/p/12880898.html