jsx-transform-cli
v0.2.0
Published
A command line interface for jsx-transform
Downloads
5
Maintainers
Readme
jsx-transform-cli
A command line interface for jsx-transform.
Installation
Install it globally with:
$ npm install -g jsx-transform-cli
Or within a project for use as an NPM script:
$ npm install --save-dev jsx-transform-cli
Usage
JSX is read from STDIN. Compiled JS is written to STDOUT.
$ echo '<div>Hello, world!</div>' | jsx-transform
h('div', null, ["Hello, world!"])
Specify a factory function with -f
or --factory
.
$ echo '<div>Hello, world!</div>' | jsx-transform --factory React.createElement
React.createElement('div', null, ["Hello, world!"])