node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »



Browserify transform module for requiring html files through domify.


With npm do:

npm install tr-domify

This will also install domify as a peerDependency.

Then in your browser code you can do:

var template = require('./templates/example.html');
var el = template.cloneNode(true);

so you get a DOM object you can clone, ready to insert into the DOM.

To know more about Browserify transforms