0.1.0 • Published 10 years ago
dot-ify v0.1.0
dot-ify
make dot templates 'requireable' when using browserify
- name the exported function as the file being required
- exports an object that contains a render method which is the compiled template
Install
npm i --save dot-ifyUsage
In code
var b = browserify();
var dotify = require('dot-ify');
// regular way to include it
b.transform(dotify);
// make it global
b.transform({ global: true}, dotify);or in the package.json file
{
"browserify" : {
"transforms": [
"dot-ify"
]
}
}Then in your code
var tpl = require('./some-tpl.dot')
var content = tpl.render({
some:'variable here'
});License
Changelog
0.1.0
10 years ago