xml-beautifier

0.5.0 • Public • Published

XML Beautifier

Tests NPM version

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-beautifier

Usage

import beautify from "xml-beautifier";

const xml = beautify("<div><span>foo</span></div>");
console.log(xml); // => will output correctly indented elements

License

MIT © Jonathan Svenheden

/xml-beautifier/

    Package Sidebar

    Install

    npm i xml-beautifier

    Weekly Downloads

    12,165

    Version

    0.5.0

    License

    MIT

    Unpacked Size

    4.67 kB

    Total Files

    5

    Last publish

    Collaborators

    • jonathanp