Simple and powerful template engine for Node.js. Under construction!
- Familiar Smarty-inspired syntax
- Auto escaping all template variables
- Inline JavaScript code
- Syntactic sugar for conditions and loops
- Template inheritance and recursive includes
- Template cutouts!
- Custom-defined template tags
- Fast - compiles to JavaScript code
Create a template file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{$title}</title>
</head>
<body>
<h1>{$title}</h1>
{@$content}
</body>
</html>
And render it with Node.js:
var cutter = require("cutter-tpl");
cutter.get("your-template.jtpl", function(err, template) {
var data = {
title: "Hello world",
content: "<p>The quick brown fox jumps over the lazy dog.</p>"
};
var output = template.fetch(data);
});
For syntax specification and API reference, please see the documentation.