
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
@frontify/dot
Advanced tools
Concise and fast javascript templating compatible with nodejs and other javascript environments
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.
custom delimiters
runtime evaluation
runtime interpolation
compile-time evaluation
partials support
conditionals support
array iterators
encoding
control whitespace - strip or preserve
streaming friendly
use it as logic-less or with logic, it is up to you
http://olado.github.com/doT (todo: update docs with new features added in version 1.0.0)
{{! }}
renders falsy values with the exception of undefined
Breaking change. The falsy values 0
, false
, null
, NaN
and an empty string, but not undefined
are stringified to their string values. For example, <p>{{! NaN }}</p>
is now rendered as <p>NaN</p>
. However, <p>{{! undefined }}</p>
is still rendered as <p></p>
.
In previous versions, an empty string was returned for any falsy value.
If you need {{! value }}
to produce an empty string where value
is falsy, write {{! value || '' }}
or {{! value || undefined }}
.
{{##def.macro:param:
<div>{{=param.foo}}</div>
#}}
{{#def.macro:myvariable}}
var dots = require("dot").process({ path: "./views"});
This will compile .def, .dot, .jst files found under the specified path. Details
Basic usage:
var dots = require("dot").process({path: "./views"});
dots.mytemplate({foo:"hello world"});
The above snippet will: * Compile all templates in views folder (.dot, .def, .jst) * Place .js files compiled from .jst templates into the same folder These files can be used with require, i.e. require("./views/mytemplate") * Return an object with functions compiled from .dot templates as its properties * Render mytemplate template
./bin/dot-packer -s examples/views -d out/views
Many people are using doT with express. I added an example of the best way of doing it examples/express:
doU.js is here only so that legacy external tests do not break. Use doT.js.
doT.js with doT.templateSettings.append=false provides the same performance as doU.js.
Laura Doktorova @olado
doT is licensed under the MIT License. (See LICENSE-DOT)
Thank you @KevinKirchner for the logo.
FAQs
Concise and fast javascript templating compatible with nodejs and other javascript environments
The npm package @frontify/dot receives a total of 1 weekly downloads. As such, @frontify/dot popularity was classified as not popular.
We found that @frontify/dot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.