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
- Connect's middleware proxy
Installation
npm install artist
API
View source for documentation.
Usage
With express:
app;
With express (production environment):
app;
Synchronous version:
var render = ;// ...var html = ;
index.xml
json.foo
Proxy
Proxy is a connect middleware. It handles requests to the templates, compiles them and wraps results into AMD module, JSONP or any other format.
AMD:
app;
GET /scripts/templates/layout.js
;
JSONP:
app;
GET /scripts/templates/layout.js?jsonp=handleTemplate
;