Testing nodes for their types is a fairly common task so it would be more practical to access to NodeType constants instead of dealing with integers (which are not documented). Here's an example of what I want to do:
const { DOMParser, NodeType } = require('@xmldom/xmldom')
const xml = new DOMParser().parseFromString(contents)
const rows = Array.from(xml.childNodes[2].childNodes).filter(node => node.nodeType == NodeType.ELEMENT_NODE)
Testing nodes for their types is a fairly common task so it would be more practical to access to NodeType constants instead of dealing with integers (which are not documented). Here's an example of what I want to do: