Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/kt3k/xat
- Owner: kt3k
- License: mit
- Created: 2017-10-05T14:39:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-18T05:08:27.000Z (about 7 years ago)
- Last Synced: 2024-11-24T09:47:29.092Z (about 1 month ago)
- Topics: jsx, react, template
- Language: JavaScript
- Size: 15.6 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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: xatOptions:
-h, --help Shows help message
-v, --version Shows version number
```# License
MIT
[react]: https://facebook.github.io/react