A minimal XML beautifier that formats XML documents by placing each tag and text node on its own line with proper indentation. The current stable version is 1.0.1, released in 2017 with no further updates since. It is a fork of xml-beautifier and offers a simple function signature with two options: indentor (custom indentation string) and textNodesOnSameLine (to compress text nodes onto the same line as their parent tags). It supports ESM imports and has no runtime dependencies.
npm install xml-but-prettierVerified import paths — ran on the pinned version, not inferred.
Formats an XML string with 2-space indentation and keeps text nodes on the same line as their parent tags.
Update call to use config object: xmlButPrettier(xml, { indentor: ' ', textNodesOnSameLine: true }).Upgrade Node.js to version 4 or higher.
Consider using an actively maintained alternative like 'xml-formatter' or 'pretty-data'.
Use import xmlButPrettier from 'xml-but-prettier'
Call xmlButPrettier(xml, { indentor: ' ', textNodesOnSameLine: true })Run npm install xml-but-prettier
No dependency data recorded yet.