# xtraverse

> Wrapper for simplifying XML traversal.

Latest version **0.1.0** (published 2013-07-31) · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2013-07-31 |
| First published | 2013-07-28 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+16 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jared Hanson |
| Maintainers | jaredhanson |
| Keywords | xml, dom, traversal, builder, jquery |

## Links

- npm: https://www.npmjs.com/package/xtraverse
- Repository: https://github.com/jaredhanson/node-xtraverse
- Issues: http://github.com/jaredhanson/node-xtraverse/issues
- npm.io page: https://npm.io/package/xtraverse

## Dependencies (1)

- [xmldom](https://npm.io/package/xmldom.md) 0.1.x

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2013-07-31
- 0.0.1 — 2013-07-28

## README

# xtraverse

Simplified traversal and building of an XML DOM.

This module provides a [jQuery](http://jquery.com/)-like wrapper, but geared for
traversing and manipulating an XML DOM, as opposeed to an HTML DOM.  The API
aims to be compatible with [Strophe.js](https://github.com/strophe/strophejs)'
`Builder` and [Less-Than XML](https://github.com/astro/ltx).  The underlying DOM
is W3C standard, provided by [XMLDOM](https://github.com/jindw/xmldom).

## Install

    $ npm install xtraverse

## Usage

#### Parse XML

```javascript
var xml = fs.readFileSync('feed.xml', 'utf8');
var feed = XT(xml);
```

#### Traverse XML

```javascript
console.log(feed.children('title').text());
for (var link = feed.children().first('link'); link.length > 0; link = link.next('link')) {
  console.log(link.attr('href'));
}
for (var entry = feed.children().first('entry'); entry.length > 0; entry = entry.next('entry')) {
  console.log('Entry: ' + entry.children('title').text());
}
```

#### Build XML

```javascript
var feed = XT('<feed xmlns="http://www.w3.org/2005/Atom"/>')
  .c('title').t('Example Feed').up()
  .c('link', { href: 'http://example.org/' })
  .c('entry').c('title').t('Atom-Powered Robots Run Amok').up().up()
  .c('entry').c('title').t('Today I Ate Pancakes');
```

## Tests

    $ npm install
    $ npm test

## Status

[![Build Status](https://secure.travis-ci.org/jaredhanson/node-xtraverse.png)](http://travis-ci.org/jaredhanson/node-xtraverse)
[![David DM](https://david-dm.org/jaredhanson/node-xtraverse.png)](http://david-dm.org/jaredhanson/node-xtraverse)

## Credits

  - [Jared Hanson](http://github.com/jaredhanson)

## License

[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>

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