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 is just like a .js
file which exports a react component.
module.exports = props => (
<div>
<p>
Hello, xat!
</p>
</div>
)
.xat
file can require another .xat
file.
wrapper.xat
module.exports = props => (
<div className="wrapper">
{props.children}
</div>
)
example.xat
const Wrapper = require('./wrapper')
module.exports = props => (
<Wrapper>
<div>
<p>
Hello, xat!
</p>
</div>
</Wrapper>
)
The above example.xat
renders to:
<div class="wrapper"><div><p>Hello, xat!</p></div></div>
const xat = require('xat')
- @param {string} filename The filename
This renders the given filename as .xat template.
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 <input.xat>
Options:
-h, --help Shows help message
-v, --version Shows version number
MIT