Skip to content
browserify plugin that allows requiring of html
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
README.md
index.js
package.json

README.md

docfragify

browserify + html -> document fragments

Usage

first install docfragify in your project npm install docfragify

then include it in your browserify command line

browserify /path/to/entry.js -p docfragify

now, you can require .html files and the resulting document fragment will be returned to you

example

span.html

<span>I'm a fragment!</span>

entry.js

var content = require('./span.html');

document.body.appendChild(content);
Something went wrong with that request. Please try again.