/unibeautify-cli

CLI for Unibeautify

Primary LanguageJavaScriptMIT LicenseMIT

Unibeautify-CLI

Build Status

CLI for Unibeautify

Installation

$ npm install --global unibeautify-cli

Usage

The package will be globally accessible as a new command-line interface (CLI) application called unibeautify.

Help

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

Example

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;
}