dot / 1.0.3 last updated 2 years ago created on Feb 15th 2011
Install
npm install --save dot
Clone
git clone git@github.com:olado/doT.git
dependencies
No dependencies listed.
maintainers
olado
versions
12 total
| 1.0.3 | 2 years ago | olado |
| 1.0.2 | 3 years ago | olado |
| 1.0.1 | 3 years ago | olado |
| 1.0.0 | 3 years ago | olado |
| 0.2.6 | 4 years ago | olado |
| 0.2.5 | 4 years ago | olado |
| 0.2.4 | 4 years ago | olado |
| 0.2.3 | 4 years ago | olado |
| 0.2.2 | 4 years ago | olado |
| 0.2.1 | 4 years ago | olado |
| 0.2.0 | 4 years ago | olado |
| 0.1.7 | 4 years ago | olado |
readme
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.
Features
Docs, live playground and samples
http://olado.github.com/doT (todo: update docs with new features added in version 1.0.0)
New in version 1.0.0
Added parameters support in partials
Node module now supports auto-compilation of dot templates from specified path
This will compile .def, .dot, .jst files found under the specified path. Details
- 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. Produced .js file can be loaded as a commonJS, AMD module, or just installed into a global variable (default is set to window.render)
All inline defines defined in the .jst file are compiled into separate functions and are available via _render.filename.definename
Basic usage:
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
- Compile all templates in views folder (.dot, .def, .jst)
CLI tool to compile dot templates into js files
Example for express
Notes
Author
Laura Doktorova @olado
License
doT is licensed under the MIT License. (See LICENSE-DOT)
Thank you Kevin Kirchner for the logo.