New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dot-module

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-module

Precompile doT.js templates and build CommonJS module.

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

#dot-module

dot-module lets you simple transform your templates directory into one CommonJS module. Best served with modules-webmake.

Installation:

npm install -g dot-module

###Usage:

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

###Options:

-d 	Target directory <path>
-o	Output file <path>

###Example:

Create a doT.js template (templates/sample.html). Templates must have a .html 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 module in your webpage you can access the template in javascript.

var templates = require('./templates'),
	scores = templates['scores'];
	
container.innerHTML = scores({
  scores: user.scores
});

Keywords

templates

FAQs

Package last updated on 15 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts