This beautifier is specially made for React.js or React native.
You can use this module on command-line using node.js
You can install the NPM package jsxbeautifier
. When installed globally, it provides an executable jsxbeautifier
script.
$ npm -g install jsxbeautifier
$ jsxbeautifier -r -f foo.js
You can also use jsxbeautifier
as a node
library (install locally, the npm
default):
$ npm install jsxbeautifier
These are the command-line flags for JS scripts:
CLI Options:
-f Input file(s) (Pass '-' for stdin)
-r Write output in-place, replacing input