tiny-xml
v2.0.1
Published
Tiny XML utility for Client and Server
Downloads
49
Maintainers
Readme
tiny-xml
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