dot-ify

0.1.0 • Public • Published

NPM Version Build Status

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-ify

Usage

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

MIT

Changelog

Changelog

Package Sidebar

Install

npm i dot-ify

Weekly Downloads

23

Version

0.1.0

License

MIT

Last publish

Collaborators

  • royriojas