Gathering detailed insights and metrics for w3c-xmlserializer
Gathering detailed insights and metrics for w3c-xmlserializer
Gathering detailed insights and metrics for w3c-xmlserializer
Gathering detailed insights and metrics for w3c-xmlserializer
An XML serializer that follows the W3C specification.
npm install w3c-xmlserializer
99.4
Supply Chain
80.1
Quality
81.8
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
21 Stars
51 Commits
10 Forks
5 Watching
1 Branches
8 Contributors
Updated on 11 May 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-8.5%
4,351,627
Compared to previous day
Last week
1.7%
25,587,463
Compared to previous week
Last month
17%
103,021,237
Compared to previous month
Last year
12.9%
1,012,503,755
Compared to previous year
1
3
An XML serializer that follows the W3C specification.
This package can be used in Node.js, as long as you feed it a DOM node, e.g. one produced by jsdom.
Assume you have a DOM tree rooted at a node node
. In Node.js, you could create this using jsdom as follows:
1const { JSDOM } = require("jsdom"); 2 3const { document } = new JSDOM().window; 4const node = document.createElement("akomaNtoso");
Then, you use this package as follows:
1const serialize = require("w3c-xmlserializer"); 2 3console.log(serialize(node)); 4// => '<akomantoso xmlns="http://www.w3.org/1999/xhtml"></akomantoso>'
requireWellFormed
optionBy default the input DOM tree is not required to be "well-formed"; any given input will serialize to some output string. You can instead require well-formedness via
1serialize(node, { requireWellFormed: true });
which will cause Error
s to be thrown when non-well-formed constructs are encountered. Per the spec, this largely is about imposing constraints on the names of elements, attributes, etc.
As a point of reference, on the web platform:
innerHTML
getter uses the require-well-formed mode, i.e. trying to get the innerHTML
of non-well-formed subtrees will throw.xhr.send()
method does not require well-formedness, i.e. sending non-well-formed Document
s will serialize and send them anyway.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 5/25 approved changesets -- score normalized to 2
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
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-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