Skip to content

Packs doT.js templates files into a single javascript file.

Notifications You must be signed in to change notification settings

law909/dot-packer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

####dot-packer.js - precompile,compress, and pack doT.js javascript template(s) into one js file.

dot-packer

Installation:

npm install -g dot-packer

Note: Based on your permissions you may have to use sudo

Dependencies:

  1. doT - The fastest + concise javascript template engine

  2. UglifyJS – a JavaScript parser/compressor/beautifier

    Note: NPM should install these automaticly

###Usage:

dot-packer -d templates/ -o ./templates.js

###Options:

-d 	Target directory <path>
-o	Output file <path>
-n  The GLOBAL variable to pack the templates in. (default:JST)

###Example:

Create a doT.js template (templates/sample.jst). Templates must have a .jst extension.

<ul id="scores">
	{{~it.scores:score:index}}
		<li>{{=score}}</li>
	{{~}}
</ul>

dot-packer -d templates/ -o ./templates.js

Once you include the templates.js file in your webpage you can access the template in javascript.

html = JST.sample(data);

About

Packs doT.js templates files into a single javascript file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%