xmlovely
Node transform stream to pretty print a compact XML stream
what it does
Turns a stream of this:
Into a stream of this:
usage
$ npm install --save xmlovely
var xmlovely =var prettyPrinter =
options
var xmlovely =var options =var prettyPrinter =
The options parameter may be a number or an object. If it is an object, it may be used to specify the whitespace character and the number of those characters that make up a "tab". If the options parameter is a number, the whitespace character will be a space, and the value of options
will be used as the tab-width.
var optionsNumber = WHITESPACE_WIDTHvar optionsObject =width: WHITESPACE_WIDTHwhitespace: WHITESPACE_CHARACTER
key | type | default |
---|---|---|
width | number | 2 |
whitespace | string | ' ' |
For example, to use 3-space "tabs":
var xmlovely =var prettyPrinter =prettyPrinterprettyPrinter/*<node>↵···<child/>↵</node>↵*/
To use actual tabs:
var xmlovely =var prettyPrinter =prettyPrinterprettyPrinter/*<node>↵→<child/>↵</node>↵*/