Skip to content

bestpika/libxmljs

Repository files navigation

libxmljs

npm version Test & Upload

npm install libxmljs

Native NodeJS bindings for libxml2 written in Typescript

var libxmljs = require("libxmljs");
var xml =
    '<?xml version="1.0" encoding="UTF-8"?>' +
    "<root>" +
    '<child foo="bar">' +
    '<grandchild baz="fizbuzz">grandchild content</grandchild>' +
    "</child>" +
    "<sibling>with content!</sibling>" +
    "</root>";

var xmlDoc = libxmljs.parseXml(xml);

// xpath queries
var gchild = xmlDoc.get("//grandchild");

console.log(gchild.text()); // prints "grandchild content"

var children = xmlDoc.root().childNodes();
var child = children[0];

console.log(child.attr("foo").value()); // prints "bar"

Docs

https://libxmljs.github.io/libxmljs/

About

libxml bindings for v8 javascript engine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 80.9%
  • TypeScript 17.3%
  • SWIG 1.4%
  • JavaScript 0.3%
  • Python 0.1%
  • Shell 0.0%