babelfmt
A `gofmt`-inspired formatter for javascript.
Last updated 4 years ago by mastercactapus .
ISC · Original npm · Tarball · package.json
$ cnpm install babelfmt 
SYNC missed versions from official npm registry.

babelfmt

A gofmt-inspired formatter for javascript.

Usage

Usage is pretty simple, run with --help to show info. If no paths are specified, code will be read from stdin.


  Usage: babelfmt [flags] [path ...]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number
    -d             display diffs instead of rewriting files
    -l             list files whos formatting differs from babelfmt's
    -w             write result to (source) file instead of stdout

Testing

To test the changes without writing you can use the -d flag:

$ babelfmt -d test.js
===================================================================
--- test.js	
+++ babelfmt/test.js	
@@ -1,1 +1,1 @@
-var foo=1;
+var foo = 1;

You can also use stdin to test code formatting (press CTRL+d when you are done):

$ babelfmt -d
var foo=1
[CTRL+d]
===================================================================
--- <standard input>	
+++ babelfmt/<standard input>	
@@ -1,1 +1,1 @@
-var foo=1
+var foo = 1;

Current Tags

  • 1.1.2                                ...           latest (4 years ago)

4 Versions

  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 6
Dependencies (13)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |