art-template is a simple and superfast templating engine that optimizes template rendering speed by scope pre-declared technique, hence achieving runtime performance which is close to the limits of JavaScript. At the same time, it supports both NodeJS and browser. speed test online.
Feature
- performance is close to the JavaScript rendering limits
- debugging friendly. Syntax errors or runtime errors will be positioned accurately at which line of template. Support setting breakpoint in templating files (Webpack Loader)
- support Express, Koa, Webpack
- support template inheritance and sub template
- browser version is only 6KB
Template
art-template simultaneously supports two syntax of template. Standard syntax allows templates to be easier to read and write. While original syntax has powerful logical processing ability.
standard syntax
{{if user}} |
original syntax
<% if (user) { %> |
Original syntax is compatible with EJS, Underscore, LoDash templates.
Render template
var template = require('art-template'); |
Core method
// render template basing on template name |