libxmljs
libxml bindings for v8 javascript engine
Last updated 15 years ago .
Repository · Original npm · Tarball · package.json
$ npm install libxmljs 
SYNC missed versions from official npm registry.

libxmljs

npm version Downloads monthly Downloads total Test & Upload

npm install libxmljs

NodeJS bindings for libxml2 written in Typescript

Documentation

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

Examples

For more examples, check out the test suite.

import libxmljs from "libxmljs";

libxmljs
    .parseXmlAsync(
        `
        <?xml version="1.0" encoding="UTF-8"?>
        <root>
            <child foo="bar">
            <grandchild baz="fizbuzz">grandchild content</grandchild>
            </child>
            <sibling>with content!</sibling>
        </root>
        `
    )
    .then((xmlDoc) => {
        const gchild = xmlDoc.find("//grandchild")[0];

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

        const child = xmlDoc.root()?.child(0);

        console.log(child?.getAttribute("foo")?.value()); // prints "bar"
    });

Package Scripts

npm run init-submodules

Clones libxml2 source code to vendor/libxml2

npm run configure

Generate new cmake config headers with cmake in vendor/libxml2.config. Used when updating to a new libxml2 version.

npm run build

Build the C++ source code using node-gyp

npm run swig

Generate a new src/libxml2.cc and swig.xml file by processing the native code using SWIG. Used when making changes to native code or any of the SWIG interface files (src/*.i)

npm run tsgenerate

Generates typescript definitons for native bindings exports. Used when changes are made to native exports. Auto-generates constants.ts, functions.ts, types.ts, and variables.ts within lib/bindings/

npm run tsc

Compiles Typescript within lib/ and outputs it to dist/ Use npm run dev to put Typescript compiler into watch mode.

npm run test

Runs all tests in test/ using nodeunit. Use npm run test -- -t TEST_NAME to run a specific test.

npm run docs

Generates docs/ using Typedoc

Current Tags

  • 1.0.11                                ...           latest (3 years ago)

55 Versions

  • 1.0.11                                ...           3 years ago
  • 1.0.10                                ...           3 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.19.10                                ...           5 years ago
  • 0.19.9                                ...           5 years ago
  • 0.19.8                                ...           5 years ago
  • 0.19.7                                ...           7 years ago
  • 0.19.5                                ...           8 years ago
  • 0.19.3                                ...           8 years ago
  • 0.19.1                                ...           8 years ago
  • 0.19.0                                ...           8 years ago
  • 0.18.9-pre0                                ...           9 years ago
  • 0.18.8                                ...           9 years ago
  • 0.18.7                                ...           9 years ago
  • 0.18.6                                ...           9 years ago
  • 0.18.4                                ...           10 years ago
  • 0.18.2                                ...           10 years ago
  • 0.18.0                                ...           11 years ago
  • 0.17.1                                ...           11 years ago
  • 0.17.0                                ...           11 years ago
  • 0.16.1                                ...           11 years ago
  • 0.16.0                                ...           11 years ago
  • 0.15.0                                ...           11 years ago
  • 0.14.3                                ...           11 years ago
  • 0.14.2                                ...           11 years ago
  • 0.14.1                                ...           12 years ago
  • 0.14.0                                ...           12 years ago
  • 0.13.0                                ...           12 years ago
  • 0.12.0                                ...           12 years ago
  • 0.11.1                                ...           12 years ago
  • 0.11.0                                ...           12 years ago
  • 0.10.0                                ...           12 years ago
  • 0.9.0                                ...           13 years ago
  • 0.8.1                                ...           14 years ago
  • 0.8.0                                ...           14 years ago
  • 0.7.1                                ...           14 years ago
  • 0.7.0                                ...           14 years ago
  • 0.6.1                                ...           14 years ago
  • 0.6.0                                ...           14 years ago
  • 0.5.4                                ...           15 years ago
  • 0.5.3                                ...           15 years ago
  • 0.5.2                                ...           15 years ago
  • 0.5.1                                ...           15 years ago
  • 0.5.0                                ...           15 years ago
  • 0.4.3                                ...           15 years ago
  • 0.4.2                                ...           15 years ago
  • 0.4.1                                ...           15 years ago
Downloads
Total 132
Today 0
This Week 14
This Month 77
Last Day 0
Last Week 2
Last Month 17
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE