tiny-xml

2.0.1 • Public • Published

tiny-xml

build status

Tiny XML utility for Client and Server

Example

const xml = require("tiny-xml"),
  serialized = xml.serialize({node: "Hello World!"}),
  valid = xml.valid(serialized),
  obj = valid ? xml.parse(serialized) : {};

console.log(valid); // true
console.log(obj.getElementsByTagName("node")[0].textContent); // Hello World!

API

parse (arg)

Parses the argument and returns a Document.

serialize (arg, key = "xml", wrap = true, top = true)

Serializes the argument as XML.

valid (arg)

Tests if the argument is valid XML.

License

Copyright (c) 2021 Jason Mulligan Licensed under the BSD-3 license

Package Sidebar

Install

npm i tiny-xml

Weekly Downloads

4

Version

2.0.1

License

BSD-3-Clause

Unpacked Size

5.76 kB

Total Files

4

Last publish

Collaborators

  • avoidwork