Gathering detailed insights and metrics for sane-domparser-error
Gathering detailed insights and metrics for sane-domparser-error
Gathering detailed insights and metrics for sane-domparser-error
Gathering detailed insights and metrics for sane-domparser-error
npm install sane-domparser-error
88.8
Supply Chain
77.2
Quality
75.1
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
17 Commits
2 Watching
1 Branches
1 Contributors
Updated on 05 Dec 2018
JavaScript (98.41%)
HTML (1.59%)
Cumulative downloads
Total Downloads
Last day
1.6%
1,998
Compared to previous day
Last week
5.4%
10,571
Compared to previous week
Last month
2.4%
44,831
Compared to previous month
Last year
46.5%
502,864
Compared to previous year
5
Provides sane and machine readable parser errors for DOMParser and XHR (with XMLHttpRequest.responseType = 'document'
).
DOMParser and XHR currently do not throw an exception if a document could not be parsed, but instead return an error document.
Instead of
1<parsererror xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml"> 2 XML Parsing Error: prefix not bound to a namespace\n Location: file:////tmp/index.html 3 Line Number 1, Column 57: 4 <sourcetext> 5 <html xmlns="http://www.w3.org/1999/xhtml"><head/><body><namespace:customtag><!-- namespace:customtag--></namespace:customtag></body></html> 6 --------------------------------------------------------^ 7 </sourcetext> 8</parsererror>
you'll receive
1new Error('XML Parsing Error: prefix not bound to a namespace');
1var saneError = require('sane-domparser-error'); 2 3var xhr = new XMLHttpRequest(); 4xhr.onload = function() { 5 saneError.failOnParseError(xhr.responseXML); 6 // ... the happy path from here ... 7} 8xhr.open("GET", "file.html"); 9xhr.responseType = "document"; 10xhr.send();
and
1var saneError = require('sane-domparser-error'); 2 3var p = new DOMParser(), 4 doc = p.parseFromString(xhtml, "application/xml"); 5 6saneError.failOnParseError(doc); 7// ... the happy path from here ...
$ npm run-script watchify
$ xdg-open test/test.html
or just
$ npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/17 approved changesets -- 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
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
61 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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