Gathering detailed insights and metrics for strip-json-comments
Gathering detailed insights and metrics for strip-json-comments
Gathering detailed insights and metrics for strip-json-comments
Gathering detailed insights and metrics for strip-json-comments
Strip comments from JSON. Lets you use comments in your JSON files!
npm install strip-json-comments
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
599 Stars
77 Commits
53 Forks
15 Watching
1 Branches
18 Contributors
Updated on 09 Nov 2024
JavaScript (95.41%)
TypeScript (4.59%)
Cumulative downloads
Total Downloads
Last day
-8%
11,660,148
Compared to previous day
Last week
1.1%
68,594,309
Compared to previous week
Last month
12.9%
281,825,637
Compared to previous month
Last year
15.8%
2,822,965,466
Compared to previous year
Strip comments from JSON. Lets you use comments in your JSON files!
This is now possible:
1{ 2 // Rainbows 3 "unicorn": /* ❤ */ "cake" 4}
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 Gulp/Grunt/Broccoli plugin.
1npm install strip-json-comments
1import stripJsonComments from 'strip-json-comments'; 2 3const json = `{ 4 // Rainbows 5 "unicorn": /* ❤ */ "cake" 6}`; 7 8JSON.parse(stripJsonComments(json)); 9//=> {unicorn: 'cake'}
Type: string
Accepts a string with JSON and returns a string without comments.
Type: object
Type: boolean
Default: false
Strip trailing commas in addition to comments.
Type: boolean
Default: true
Replace comments and trailing commas with whitespace instead of stripping them entirely.
1npm run bench
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 9/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More