Comparing version 1.0.3 to 1.1.0
@@ -27,3 +27,4 @@ // doT.js | ||
template: undefined, //fn, compile template | ||
compile: undefined //fn, for express | ||
compile: undefined, //fn, for express | ||
log: true | ||
}, _globals; | ||
@@ -30,0 +31,0 @@ |
@@ -119,2 +119,18 @@ Advanced templating: illustrates defines and includes. | ||
{{##def.testFunctionWithParam = function(str) { | ||
return "My name is: " + str; | ||
} | ||
#}} | ||
{{##def.mytestparam: {{=it.name}} #}} | ||
{{#def.testFunctionWithParam(def.mytestparam)}} | ||
{{#def.testFunctionWithParam("\{\{=it.name\}\}")}} | ||
{{##def.testParamDef:myparam: | ||
My name is: {{=myparam}} | ||
#}} | ||
{{#def.testParamDef:it.name}} | ||
The end |
(function() { | ||
var doT = require('../doT.js'), | ||
fs = require('fs'), | ||
data = { f1: 1, f2: 2, f3: 3, altEmail: "conditional works", farray:[{farray:[1,2,3,[11,22,33]],person:{name:'Ell',age:23}},{farray:{how:'really'}}, {farray:[5,6,7,8]}]}, | ||
data = { name: "Foo", f1: 1, f2: 2, f3: 3, altEmail: "conditional works", farray:[{farray:[1,2,3,[11,22,33]],person:{name:'Ell',age:23}},{farray:{how:'really'}}, {farray:[5,6,7,8]}]}, | ||
defs = { a: 100, b: 200}; | ||
@@ -6,0 +6,0 @@ |
@@ -116,3 +116,3 @@ /* doT + auto-compilation of doT templates | ||
InstallDots.prototype.compileAll = function() { | ||
console.log("Compiling all doT templates..."); | ||
if (doT.log) console.log("Compiling all doT templates..."); | ||
@@ -126,3 +126,3 @@ var defFolder = this.__path, | ||
if (/\.def(\.dot|\.jst)?$/.test(name)) { | ||
console.log("Loaded def " + name); | ||
if (doT.log) console.log("Loaded def " + name); | ||
this.__includes[name.substring(0, name.indexOf('.'))] = readdata(defFolder + name); | ||
@@ -135,7 +135,7 @@ } | ||
if (/\.dot(\.def|\.jst)?$/.test(name)) { | ||
console.log("Compiling " + name + " to function"); | ||
if (doT.log) console.log("Compiling " + name + " to function"); | ||
this.__rendermodule[name.substring(0, name.indexOf('.'))] = this.compilePath(defFolder + name); | ||
} | ||
if (/\.jst(\.dot|\.def)?$/.test(name)) { | ||
console.log("Compiling " + name + " to file"); | ||
if (doT.log) console.log("Compiling " + name + " to file"); | ||
this.compileToFile(this.__destination + name.substring(0, name.indexOf('.')) + '.js', | ||
@@ -142,0 +142,0 @@ readdata(defFolder + name)); |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"main": "index", | ||
@@ -22,14 +22,27 @@ "bin": { | ||
], | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "nyc mocha" | ||
}, | ||
"dependencies": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"commander": "*", | ||
"uglify-js": "*", | ||
"coveralls": "^2.11.14", | ||
"jshint": "*", | ||
"mkdirp": "*", | ||
"mocha":"*", | ||
"jshint":"*" | ||
"mocha": "*", | ||
"nyc": "^8.3.2", | ||
"pre-commit": "^1.1.3", | ||
"uglify-js": "*" | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"test", | ||
"node_modules" | ||
], | ||
"reporter": [ | ||
"lcov", | ||
"text-summary" | ||
] | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
# 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. | ||
@@ -5,2 +7,7 @@ | ||
[![Build Status](https://travis-ci.org/olado/doT.svg?branch=master)](https://travis-ci.org/olado/doT) | ||
[![npm version](https://badge.fury.io/js/dot.svg)](https://www.npmjs.com/package/dot) | ||
[![Coverage Status](https://coveralls.io/repos/github/olado/doT/badge.svg?branch=master)](https://coveralls.io/github/olado/doT?branch=master) | ||
## Features | ||
@@ -75,3 +82,3 @@ custom delimiters | ||
## Author | ||
Laura Doktorova @olado | ||
Laura Doktorova [@olado](http://twitter.com/olado) | ||
@@ -85,4 +92,2 @@ ## License | ||
Thank you Kevin Kirchner for the logo. | ||
Thank you [@KevinKirchner](https://twitter.com/kevinkirchner) for the logo. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65056
33
1406
91
8
2