coffee-fmt

v0.12.0
a `gofmt` inspired Coffeescript formatter/beautifier.
coffee coffeescript fmt gofmt format formatter beautify beautifier coffee-beautify and 2 more...

coffee-fmt

a gofmt inspired Coffeescript formatter/beautifier.

npm install -g coffee-fmt

coffee-fmt --indent_style [space|tab] \
     --indent_size [Integer, ignored when using tabs] \
     --debug=true (This will print all parse info to stdout as well, defaults to false)
     -i filename.coffee >> transformed.coffee

###js api###

    var fmt = require('coffee-fmt')
    , fs = require('fs')
    , coffee
    , options
    ;

    options = {
        tab: '\t',
        newLine: '\n'
    };

    coffee = fs.readFileSync('filename.coffee');
    coffee = coffee.toString();

    try {
        coffee = fmt.format(coffee, options);
    } catch (e) {
        //Whoops...something went wrong, error details logged to console.
    }

    console.log(coffee);
npm i coffee-fmt

Metadata

  • MIT
  • Whatever
  • Steven R. Terpe
  • released 12/2/2015

Downloads

Maintainers