Skip to content
/ doT Public
forked from olado/doT

The fastest + concise javascript template engine for nodejs and browsers. Partials, custom delimiters and more.

License

Notifications You must be signed in to change notification settings

mgutz/doT

 
 

Repository files navigation

doT

Created in search of the fastest and concise JavaScript templating function with emphasis on performance under V8 and nodejs. It shows great performance for both nodejs and browsers.

doT.js is fast, small and has no dependencies.

See jsperf benchmarks for an equal playground (encodes HTML values) comparison.

Features

  • custom delimiters
  • runtime evaluation
  • runtime interpolation
  • compile-time evaluation
  • partials support
  • conditionals support
  • array iterator
  • encoding
  • control whitespace - strip or preserve
  • streaming friendly
  • use it as logic-less or with logic, it is up to you
  • ! coffeescript block
  • ! comment
  • ! object iterator

original doT playground

Differences

I created this fork for two reasons:

  1. doT templates are hard as heck to debug.
  2. No comment feature.

To get meaningful errors, set dot.templateSettings

{ append: false, strip: false }

New Features

Comments

{{-- This is a comment }}

CoffeeScript blocks

{{`cs
    a = it?.prop || 'default'
}}

Object iterator

{{. it.fruits :value :key }}
    {{= key}} = {{= value}}
{{.}}

License

  • doT is an open source component of http://bebedo.com
  • doT is licensed under the MIT License. (See LICENSE-DOT)

About

The fastest + concise javascript template engine for nodejs and browsers. Partials, custom delimiters and more.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%