Gathering detailed insights and metrics for better-error-message-for-json-parse
Gathering detailed insights and metrics for better-error-message-for-json-parse
Gathering detailed insights and metrics for better-error-message-for-json-parse
Gathering detailed insights and metrics for better-error-message-for-json-parse
If JSON.parse has failed, it should show the place where the error is.
npm install better-error-message-for-json-parse
Typescript
Module System
Node Version
NPM Version
69.5
Supply Chain
81.2
Quality
75.5
Maintenance
100
Vulnerability
100
License
TypeScript (99.2%)
JavaScript (0.8%)
Total Downloads
36,761
Last Day
16
Last Week
754
Last Month
2,797
Last Year
17,103
1 Stars
14 Commits
1 Watchers
9 Branches
1 Contributors
Updated on Jan 31, 2023
Minified
Minified + Gzipped
Latest Version
0.1.6
Package Id
better-error-message-for-json-parse@0.1.6
Unpacked Size
10.40 kB
Size
5.18 kB
File Count
12
NPM Version
3.10.10
Node Version
6.11.2
Cumulative downloads
Total Downloads
Last Day
0%
16
Compared to previous day
Last Week
63.2%
754
Compared to previous week
Last Month
33.1%
2,797
Compared to previous month
Last Year
133.2%
17,103
Compared to previous year
6
The main goal of this project is to provide a nice error message for the SyntaxError
that may occur while parsing JSON data.
For example, parsing the following JSON:
{
"index": 1,
"index_start_at": 56,
"integer": 6,
"float": 11.6816,
"name": "Eva",
"surname" "Rowland",
"fullname": "Denise Pickett",
"email": "jack@garrison.vc",
"bool": false
}
will result in the following error message:
Unexpected string in JSON at position 105
"name": "Eva",
"surname" "Rowland",
-----------^
"fullname": "Denise Pickett"
1var { safeJsonParse } = require('better-error-message-for-json-parse');
1try { 2 safeJsonParse('{"a": 2, "b": 3, "v" 3, "e": 4 }'); 3} catch (e) { 4 console.log(e); 5}
$ node index.js
SyntaxError: Unexpected number in JSON at position 21
{"a": 2, "b": 3, "v" 3, "e": 4 }
--------------------^
at exports.safeJsonParse
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/4 approved changesets -- score normalized to 0
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
license file not detected
Details
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
Reason
45 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
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