Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/kt3k/xat

JSX as template - React based template engine
https://github.com/kt3k/xat

jsx react template

Last synced: 23 days ago
JSON representation

JSX as template - React based template engine

Awesome Lists containing this project

README

        

# xat v1.1.1

> JSX as template - React based template engine

Supports Node.js >= 6.x

Pronounced like /zat/.

`xat` is template engine based on [react][] technology. You can use react components for creating pure static html.

# `.xat` file

`.xat` file is just like a `.js` file which exports a react component.

```js
module.exports = props => (



Hello, xat!



)
```

`.xat` file can require another `.xat` file.

wrapper.xat

```js
module.exports = props => (


{props.children}

)
```

example.xat

```js
const Wrapper = require('./wrapper')

module.exports = props => (



Hello, xat!




)
```

The above `example.xat` renders to:

```

Hello, xat!


```

# API

```js
const xat = require('xat')
```

## xat(filename)

- @param {string} filename The filename

This renders the given filename as .xat template.

# CLI

Install via npm:

npm i -g xat

This installs `xat` command. This command takes one argument and renders the given file as .xat template.

```
Usage: xat

Options:
-h, --help Shows help message
-v, --version Shows version number
```

# License

MIT

[react]: https://facebook.github.io/react