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. doT is a really solid piece of software engineering (I didn’t create it) that is rarely updated exactly for this reason. It took me years to grasp how it works even though it’s only 140 lines of code, it looks like magic. I used it in my other projects (e.g. ajv) as the smallest, fastest and most functional (all three!) templating engine ever made, that is particularly useful in all code generation scenarios where manipulating AST is overkill. doT allows arbitrary JavaScript code in templates, making it one of the most flexible and powerful templating engines. It means that doT security model assumes that you only use trusted templates and you don't use any user input as any part of the template, as otherwise it can lead to code injection.

Features

  • It ignores sub-directories
  • Template files can have multiple extensions at the same time
  • Files with .def extension can be included in other files via {{#def.name}}
  • Files with .dot extension are compiled into functions with the same name and can be accessed as renderer.filename
  • Files with .jst extension are compiled into .js files
  • All inline defines defined in the .jst file are compiled into separate functions and are available via _render.filename.definename

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow doT

doT Web Site

Other Useful Business Software
AI-generated apps that pass security review Icon
AI-generated apps that pass security review

Stop waiting on engineering. Build production-ready internal tools with AI—on your company data, in your cloud.

Retool lets you generate dashboards, admin panels, and workflows directly on your data. Type something like “Build me a revenue dashboard on my Stripe data” and get a working app with security, permissions, and compliance built in from day one. Whether on our cloud or self-hosted, create the internal software your team needs without compromising enterprise standards or control.
Try Retool free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of doT!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Database Engines Servers, JavaScript Admin Templates

Registered

2021-11-23