0.0.5 • Published 11 years ago

dot-packer v0.0.5

Weekly downloads
7
License
-
Repository
github
Last release
11 years ago

####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);
0.0.5

11 years ago

0.0.1

12 years ago