reinmar / dot Goto Github PK
View Code? Open in Web Editor NEWThis project forked from olado/dot
Concise and fast javascript templating compatible with nodejs and other javascript environments
License: Other
This project forked from olado/dot
Concise and fast javascript templating compatible with nodejs and other javascript environments
License: Other
Created in search of the fast and concise JavaScript templating function with emphasis on performance under V8 and nodejs. doT can be used with nodejs and other javascript environments. doT.js is a blend of jQote2 and underscore.js templating functions with some additions. jQote2 technique provides for fast performance and also enables flushing data to the stream at any point in the generated template function, this is handy when using on server. Features: custom delimiters, runtime evaluation, runtime interpolation, compile-time evaluation, partials support, encoding, control whitespace - strip or preserve, streaming friendly Benchmarks: jslitmus is used for benchmarking. To run the benchmarks for measuring execution of compiled templates: In the browser: navigate to benchmarks/index.html or go to http://olado.github.com/doT/bench.html With node: node benchmarks/templatesBench.js doT.js vs other engines: http://jsperf.com/dom-vs-innerhtml-based-templating To run the benchmarks for measuring compilation speed: In the browser: navigate to benchmarks/genspeed.html With node: node benchmarks/compileBench.js Install doT: npm install dot // use require('dot') in your code if you installed with npm Usage: Default delimiters: {{= }} for interpolation, {{ }} for evaluation, {{! }} for interpolation with encoding, {{# }} for compile-time evaluation/includes and partials, {{## #}} for compile-time defines Other delimiters may be configured. To control whitespace use 'strip' option, true - to strip, false - to preserve. Sample: // 1. Compile template function var tempFn = doT.template("<h1>Here is a sample template {{=it.foo}} </h1>"); // 2. Use template function as many times as you like var resultText = tempFn({foo: 'with doT'}); Basic template sample: https://github.com/olado/doT/blob/master/examples/snippet.txt Advanced template sample: https://github.com/olado/doT/blob/master/examples/advancedsnippet.txt Note about doU.js: doU.js is here only so that legacy extrenal tests do not break. Use doT.js. doT.js with doT.templateSettings.append=false provides the same performance as doU.js. License: doT is an open source component of http://bebedo.com doT is licensed under the MIT License. (See LICENSE-DOT)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.