Gathering detailed insights and metrics for require-json5
Gathering detailed insights and metrics for require-json5
Gathering detailed insights and metrics for require-json5
Gathering detailed insights and metrics for require-json5
Require JSON5 files in node - a better JSON for ES5 era
npm install require-json5
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
2,084,370
Last Day
606
Last Week
9,142
Last Month
40,085
Last Year
372,830
MIT License
3 Stars
12 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Mar 20, 2024
Minified
Minified + Gzipped
Latest Version
1.3.0
Package Id
require-json5@1.3.0
Unpacked Size
13.91 kB
Size
4.76 kB
File Count
13
NPM Version
7.18.1
Node Version
16.4.2
Cumulative downloads
Total Downloads
Last Day
51.1%
606
Compared to previous day
Last Week
6%
9,142
Compared to previous week
Last Month
5.2%
40,085
Compared to previous month
Last Year
-8.1%
372,830
Compared to previous year
1
3
Require JSON5 files in node - a better JSON for the JSNext era
JSON5 is more human friendly, can contain comments, trailing commas, unquoted keys and more!
1npm i -S require-json5
Include the lib:
1const requireJSON5 = require('require-json5');
1let config = require("./config.json5"); 2 // or w/o the extension, when "./config.json5" exists and there is no "./config.json", nor "./config.js" 3let config = require("./config");
.json
file in JSON5 format1let config = requireJSON5("./config.json");
.json5
file extension
and prefer to keep JSON5 in .js
files.1let config = requireJSON5("./config.js");
1let config = requireJSON5.parse('{ name: /*a very important option*/ "value" }');
require(.json)
calls1require('require-json5').replace(); 2let config = require("./config"); // can be config.json, config.json5 or config.js
require(.json)
1require('require-json5').restore();
The following is a contrived example, but it illustrates most of the features:
1{ 2 foo: 'bar', 3 while: true, 4 5 this: 'is a \ 6multi-line string', 7 8 // this is an inline comment 9 here: 'is another', // inline comment 10 11 /* this is a block comment 12 that continues on another line */ 13 14 hex: 0xDEADbeef, 15 half: .5, 16 delta: +10, 17 to: Infinity, // and beyond! 18 19 finally: 'a trailing comma', 20 oh: [ 21 "we shouldn't forget", 22 'arrays can have', 23 'trailing commas too', 24 ], 25}
For more details on the JSON5
format see the json5 library.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-30
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