javascript 模板引擎 artTemplate

码农软件 · 软件分类 · 模板引擎 · 2019-08-24 06:13:10

软件介绍

artTemplate 是新一代 javascript 模板引擎,它采用预编译方式让性能有了质的飞跃,并且充分利用 javascript 引擎特性,使得其性能无论在前端还是后端都有极其出色的表现。在 chrome 下渲染效率测试中分别是知名引擎 Mustache 与 micro tmpl 的 25 、 32 倍。

除了性能优势外,调试功能也值得一提。模板调试器可以精确定位到引发渲染错误的模板语句,解决了编写模板过程中无法调试的痛苦,让开发变得高效,也避免了因为单个模板出错导致整个应用崩溃的情况发生。

artTemplate 这一切都在 1.7kb(gzip) 中实现!

所有特性列表

  • 接近javascript极限的渲染速度
  • 支持捕获引发渲染错误的模板语句
  • 默认采用原生语法
  • 在沙箱中执行模板代码
  • 可通扩展简洁的自定义语法
  • 可定义公用函数
  • 未定义的数据输出空值

示例模板:

<script id="t-list" type="text/html">
<ul>
    <% for (i = 0; i < list.length; i ++) { %>
        <li>条目内容 <%= i + 1 %> :<%= list[i] %></li>
    <% } %>
</ul>
</script>   

本文地址:https://www.codercto.com/soft/d/13037.html

The Nature of Code

The Nature of Code

Daniel Shiffman / The Nature of Code / 2012-12-13 / GBP 19.95

How can we capture the unpredictable evolutionary and emergent properties of nature in software? How can understanding the mathematical principles behind our physical world help us to create digital w......一起来看看 《The Nature of Code》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

SHA 加密
SHA 加密

SHA 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具