This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
tr-domify with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
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.