Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dot

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

benchmarks/compileBench.js

4

doT.js

@@ -9,5 +9,5 @@ // doT.js

var doT = {
version: '1.0.0',
version: '1.0.1',
templateSettings: {
evaluate: /\{\{([\s\S]+?\}?)\}\}/g,
evaluate: /\{\{([\s\S]+?(\}?)+)\}\}/g,
interpolate: /\{\{=([\s\S]+?)\}\}/g,

@@ -14,0 +14,0 @@ encode: /\{\{!([\s\S]+?)\}\}/g,

@@ -10,3 +10,3 @@ {

],
"version": "1.0.1",
"version": "1.0.2",
"main": "index",

@@ -13,0 +13,0 @@ "bin": {

@@ -5,3 +5,3 @@ 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.

## Features:
## Features
custom delimiters

@@ -19,14 +19,10 @@ runtime evaluation

## Docs, live playground and samples:
## 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:
## New in version 1.0.0
Node module now supports auto-compilation of dot templates from specified path: (see index.js)
####Added parameters support in partials
var dots = require("dot").process({ path: "./views"});
Added parameters support in partials:
{{##def.macro:param:

@@ -38,14 +34,42 @@ <div>{{=param.foo}}</div>

Compile tool to compile dot templates into js files (thanks to @Katahdin https://github.com/Katahdin/dot-packer ):
####Node module now supports auto-compilation of dot templates from specified path
var dots = require("dot").process({ path: "./views"});
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:
```
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
####CLI tool to compile dot templates into js files
./bin/dot-packer -s examples/views -d out/views
## Notes:
## Notes
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.
## Author:
## Author
Laura Doktorova @olado
## License:
## License
doT is licensed under the MIT License. (See LICENSE-DOT)

@@ -1,2 +0,2 @@

var assert = require("assert"), doT = require("../doT.js");
var assert = require("assert"), doT = require("../doT");

@@ -3,0 +3,0 @@ describe('doT', function(){

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc