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
npm install require-json5
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,942,542
Last Day
1,749
Last Week
1,749
Last Month
18,608
Last Year
355,356
3 Stars
12 Commits
2 Watching
1 Branches
1 Contributors
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
0%
1,749
Compared to previous day
Last week
-46.8%
1,749
Compared to previous week
Last month
-6%
18,608
Compared to previous month
Last year
-16.1%
355,356
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
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
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-02-03
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