libxml bindings for v8 javascript engine
npm install @loanlink-nl/libxmljs2N-API bindings to the native libxml2 library.
Works with Node >= 20 (Bun support experimental).
If you need anything that's included in libxml2 but not exposed by this module, don't hesitate to open an issue or to create a PR.
``javascript
import * as libxmljs from '@loanlink-nl/libxmljs2';
const xml =
'' +
'
'
'
'
'
'
const xmlDoc = libxmljs.parseXml(xml);
const gchild = xmlDoc.get('//grandchild');
console.log(gchild.text());
// "grandchild content"
const children = xmlDoc.root().childNodes();
const child = children[0];
console.log(child.attr('foo').value());
// "bar"
``
Compared to libxmljs and libxmljs2:
- Migrated from NAN to N-API
- Running + passing test-suite
- Support for Node >= 20
- Experimental Bun support
- Libxml2 2.15.1 (resolving 9 CVEs)