0.5.0 • Published 5 years ago
xml-beautifier v0.5.0
XML Beautifier
This module "beautifies" XML documents by putting each tag and text node on their own line and correctly indents everything.
Can be used e.g. if you're using React as a static page generator and (for some reason) need the generated HTML to be more human-readable.
Install
$ npm install --save xml-beautifierUsage
import beautify from "xml-beautifier";
const xml = beautify("<div><span>foo</span></div>");
console.log(xml); // => will output correctly indented elementsLicense
MIT © Jonathan Svenheden