document.head polyfill for CommonJS
JavaScript HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
LICENSE
README.md
head.js
package.json

README.md

document.head shim for CommonJS

This takes Mathias Bynens's document.head polyfill and puts it in CommonJS.

Install it with npm:

npm install document.head

And then use it with Browserify or Webpack:

var head = require('document.head');
head.appendChild(/* ... */);

You can also use this to add document.head support, but note that some browsers (like Safari) throw an error when trying to reassign document.head when in strict mode.

document.head = require('document.head');

Enjoy!