Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wildlyinaccurate/jsx-transform-cli

A command line interface for jsx-transform
https://github.com/wildlyinaccurate/jsx-transform-cli

Last synced: 5 days ago
JSON representation

A command line interface for jsx-transform

Awesome Lists containing this project

README

        

# jsx-transform-cli

[![Build Status](https://travis-ci.org/wildlyinaccurate/jsx-transform-cli.svg?branch=master)](https://travis-ci.org/wildlyinaccurate/jsx-transform-cli)

A command line interface for [jsx-transform](https://github.com/alexmingoia/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 '

Hello, world!
' | jsx-transform
h('div', null, ["Hello, world!"])
```

Specify a factory function with `-f` or `--factory`.

```
$ echo '

Hello, world!
' | jsx-transform --factory React.createElement
React.createElement('div', null, ["Hello, world!"])
```