Description
For more advanced usage check the t_test.html.
This software is released under the MIT license.
t.js alternatives and similar libraries
Based on the "Templating Engines" category.
Alternatively, view t.js alternatives based on common mentions on social networks and blogs.
-
marko
A fast, lightweight, HTML-based templating engine for Node.js and the browser with async, streaming, custom tags and CommonJS modules as compiled output. -
eleventy 🕚⚡️
A simpler static site generator. An alternative to Jekyll. Transforms a directory of templates (of varying types) into HTML. -
nunjucks
A rich and powerful templating language for JavaScript from Mozilla. -
doT
The fastest + concise javascript template engine for nodejs and browsers. -
swig
A simple, powerful, and extendable Node.js and browser-based JavaScript template engine. -
JavaScript-Templates
< 1KB lightweight, fast & powerful JavaScript templating engine with zero dependencies. -
Inky
Convert a simple HTML syntax into tables compatible with Foundation for Emails. -
squirrelly
✨ Modern, ⚡️ fast, lightweight, zero-dep, and configurable JS template engine -
eta (η)
Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of t.js or a related project?
Popular Comparisons
README
t.js
A tiny javascript templating framework in ~400 bytes gzipped
t.js
is a simple solution to interpolating values in an html string for insertion into the DOM via innerHTML
.
Features
- Simple interpolation:
{{=value}}
- Scrubbed interpolation:
{{%unsafe_value}}
- Name-spaced variables:
{{=User.address.city}}
- If/else blocks:
{{value}} <<markup>> {{:value}} <<alternate markup>> {{/value}}
- If not blocks:
{{!value}} <<markup>> {{/!value}}
- Object/Array iteration:
{{@object_value}} {{=_key}}:{{=_val}} {{/@object_value}}
- Multi-line templates (no removal of newlines required to render)
- Render the same template multiple times with different data
- Works in all modern browsers
How to use
var template = new t("<div>Hello {{=name}}</div>");
document.body.innerHtml = template.render({name: "World!"});
For more advanced usage check the t_test.html
.
This software is released under the MIT license.
Coffeescript version maintained by @davidrekow
PHP version maintained by @ramon82
*Note that all licence references and agreements mentioned in the t.js README section above
are relevant to that project's source code only.