A streaming XML beautifier.
Fully customizable.
Opt-in – no magic.
Heads up! This is DEFINITELY NOT READY FOR USE YET. Ideas and criticism are very welcome though.
Make sure you have Node.js or io.js. On Unix-like systems you’re best off with nvm. Windows have official installers.
Install the CLI for your user:
$ npm install --global format-xml
Out of the box – minimal output:
$ format-xml < dirty.xml > clean.xml
Smart presets:
$ format-xml --preset svg < dirty.svg > clean.svg
CLI configuration:
$ format-xml --indent-string "\t" < dirty.xml > clean.xml
JSON or safe CSON configuration:
$ echo "indentString: '\t'" > .format-xml.cson
$ format-xml < dirty.xml > clean.xml
$ # or:
$ format-xml --config-file .format-xml.cson < dirty.xml > clean.xml
This tool is focused and configurable. If you’re after something else, you might try these out: