# t.js **Repository Path**: mirrors_leecade/t.js ## Basic Information - **Project Name**: t.js - **Description**: A tiny javascript templating framework in ~400 bytes gzipped - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2026-02-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## 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}} <> {{:value}} <> {{/value}}` * If not blocks: `{{!value}} <> {{/!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("
Hello {{=name}}
"); document.body.innerHtml = template.render({name: "World!"}); For more advanced usage check the [`t_test.html`](https://github.com/jasonmoo/t.js/blob/master/t_test.html). This software is released under the MIT license. ___ [Coffeescript version](https://github.com/davidrekow/t.coffee) maintained by [@davidrekow](https://github.com/davidrekow)