Artist
Artist is a template engine for node.js built on fest.
Features:
- Caches compiled templates
- Synchronous and asynchronous API
- Express-compatible
- Handles fest's runtime errors
Installation
npm install artist
API
Provides render()
and renderSync()
functions. View source for documentation.
Usage
With express:
app.engine('xml', require('artist').render());
With express (production environment):
app.engine('xml', require('artist').render({
cache: true,
debug: false
}));
Synchronous version:
var render = require('artist').renderSync();
var html = render('index.xml', {foo: 'bar'});
index.xml
<?xml version="1.0"?>
<fest:template xmlns:fest="http://fest.mail.ru" context_name="json">
<fest:value>json.foo</fest:value>
</fest:template>