Give me a JSON file, and I will generate JSX components.
npm install --save-dev jsxjam-cli
Usage: jsxjam <input> [options]
<input> can be a valid json or json string
Options:
-h, --help output usage information
-V, --version output the version number
-c, --context [json string] pass in variables to be passed as `context` object to the template file
-o, --output [path] path to directory where the generated JSX files end up. Defaults to ./
-t, --template [path] use your own component template
-e, --ext [extension] file extension used for generated JSX files. Defaults to jsx
--baseDir [path] appended to output path where all generated files go
See an example in action on the wiki
- The
config
property in your input JSON can also be set in a.jsxjamrc
JSON file in the directory from which you're running the command.
stateless - set to true
and you will get the stateless version of a component
pureRender - set to true
and the default template will import pure-render-decorator and use it
redux - set to true
and the default template will add connect
and mapStateToProps()
to your component
See these in action in the example on the wiki
$ git clone [email protected]:jsxjam/jsxjam-cli.git
$ cd jsxjam-cli/
$ npm install
$ npm link
After linking, jsxjam
becomes a global command for you to try out and hack away.
Thanks!