CLI for Unibeautify
$ npm install --global unibeautify-cli
The package will be globally accessible as a new command-line interface (CLI) application called unibeautify
.
Note: Not all options are currently supported.
$ unibeautify --help
Usage: unibeautify [options] [files...]
Options:
-h, --help output usage information
-V, --version output the version number
-l, --language <language> Language of file to beautify
-o, --out-file <file> Output file of beautified results
-r, --replace Replace file(s) with beautified results
-c, --config-file <file> Beautifier configuration file
--config-json <JSON> Beautifier configuration as stringified JSON
Install a Beautifier, such as beautifier-prettydiff
:
$ npm install --global beautifier-prettydiff
Then beautify using a language that Beautifier supports:
$ echo "function(n){return n+1;}" | unibeautify --language JavaScript --config-json '{"JavaScript":{"insize":2,"inchar":" "}}'
This returns the following formatted result:
function (n) {
return n + 1;
}