# libxmljs2

> libxml bindings for v8 javascript engine

Latest version **0.37.0** (published 2025-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install libxmljs2
pnpm add libxmljs2
yarn add libxmljs2
bun add libxmljs2
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.37.0 |
| Published | 2025-06-01 |
| First published | 2019-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22 |
| Dependencies | 4 |
| Unpacked size | 6.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 9 |
| Author | marudor |
| Maintainers | marudor |

## Links

- npm: https://www.npmjs.com/package/libxmljs2
- Repository: https://github.com/marudor/libxmljs2
- Homepage: https://github.com/marudor/libxmljs2#readme
- Issues: http://github.com/marudor/libxmljs2/issues
- npm.io page: https://npm.io/package/libxmljs2

## Dependencies (4)

- [nan](https://npm.io/package/nan.md) ~2.22.2
- [bindings](https://npm.io/package/bindings.md) ~1.5.0
- [node-gyp](https://npm.io/package/node-gyp.md) ^11.2.0
- [prebuild-install](https://npm.io/package/prebuild-install.md) ^7.1.3

## Recent versions

- 0.37.0 (latest) — 2025-06-01
- 0.35.0 — 2024-07-27
- 0.33.0 — 2023-11-04
- 0.32.0 — 2023-04-21
- 0.31.0 — 2022-10-22
- 0.30.1 — 2022-04-25
- 0.30.0 — 2022-04-25
- 0.29.0 — 2021-10-22
- 0.28.0 — 2021-08-30
- 0.27.0 — 2021-05-06
- 0.26.7 — 2021-03-18
- 0.26.6 — 2021-01-04
- 0.26.5 — 2020-11-19
- 0.26.4 — 2020-11-13
- 0.26.3 — 2020-10-09
- … 23 more at https://npm.io/package/libxmljs2/versions

## README

# NO LONGER MAINTAINED

# Libxmljs2

LibXML bindings for [node.js](http://nodejs.org/)
This package was forked as the original one is fairly unmaintained.

```javascript
var libxmljs = require('libxmljs2');
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"
```

## Support

- Docs - [http://github.com/marudor/libxmljs2/wiki](http://github.com/marudor/libxmljs2/wiki)

## API and Examples

Check out the wiki [http://github.com/marudor/libxmljs2/wiki](https://github.com/marudor/libxmljs2/wiki).

See the [examples](https://github.com/marudor/libxmljs2/tree/main/examples) folder.

## Installation via [npm](https://npmjs.org)

```shell
npm install libxmljs2
```

## Contribute

Start by checking out the [open issues](https://github.com/marudor/libxmljs2/issues?labels=&page=1&state=open). Specifically the [desired feature](https://github.com/marudor/libxmljs2/issues?labels=desired+feature&page=1&state=open) ones.

### Requirements

Make sure you have met the requirements for [node-gyp](https://github.com/TooTallNate/node-gyp#installation). You DO NOT need to manually install node-gyp; it comes bundled with node.

---
_Source: https://npm.io/package/libxmljs2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
