0.8.1 • Published 7 years ago

xml-lite v0.8.1

Weekly downloads
24
License
MIT
Repository
github
Last release
7 years ago

xml-lite

Maintaining XML in pure javascript (IN BOTH NODE.JS & BROWSERS) Homepage

Maintaining?

Converting

converting

Editing/Traversing

XMLLite.findChildNode(doc, query);
XMLLite.findChildNodes(doc, query);
XMLLite.findOrCreateChildNode(doc, query);
XMLLite.removeChildNode(doc, query);
XMLLite.eachChildNode(doc, query, callback);
// ...

Formatting

XMLLite.beautify(xml, indent);
XMLLite.uglify(xml, preserveComments);
XMLLite.sanitize(xml, reverse);
// ...

Actually, you can get the js object from XMLLite.xml2js(xml), do whatever you want, and convert it back to xml again with XMLLite.js2xml(obj).

Why?

  1. A reasonable need for usage in both Node.js and Browsers
  2. A more reasonable need to use native APIs(DOMParser/XMLSerializer) to speed up the maintaining process and keep the library thin

Why xml-lite?

  1. It works exactly the same in both Node.js and Browsers
  2. The browser version is supper light-weight(dist/xml-lite.js)
  3. Convenient APIs for converting between xml/js/json/DOM, and lots of helpers to maintain the data structures
  4. Super fast. it takes less than 30ms to convert an xml document with over 1,000 nodes into a js object

Install

$ npm install xml-lite --save
$ npm install xml-lite -g

Usage

In Node.js

const XMLLite = require('xml-lite');

Command line client

$ xml-lite --help

In browsers

<script src="$path/to/xml-lite/dist/xml-lite.js"> <!-- window.XMLLite is available -->

In browsers with webpack

import XMLLite from 'xml-lite/lib/index-browser';

Demo

API

JSON spec

Roadmap

Projects using xml-lite

Contributing

known issues

0.8.1

7 years ago

0.8.0

7 years ago

0.7.9

7 years ago

0.7.8

7 years ago

0.7.7

7 years ago

0.7.6

7 years ago

0.7.5

7 years ago

0.7.4

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

8 years ago

0.6.9

8 years ago

0.6.8

8 years ago

0.6.7

8 years ago

0.6.6

8 years ago

0.6.5

8 years ago

0.6.4

8 years ago

0.6.3

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.3

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago