format-xml
A streaming XML beautifier.
Fully customizable.
Opt-in – no magic.
Heads up: This is a work in progress. Ideas and criticism are very welcome.
Installation
-
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
Usage
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