Skip to content

Instantly share code, notes, and snippets.

@ehgoodenough
Created October 13, 2014 21:00
Show Gist options
  • Select an option

  • Save ehgoodenough/a404b7f309ff6fc8c0dd to your computer and use it in GitHub Desktop.

Select an option

Save ehgoodenough/a404b7f309ff6fc8c0dd to your computer and use it in GitHub Desktop.
wrapit.js
var fs = require("fs");
var jsdom = require("jsdom");
fs.readFile("home.html", function(errors, data) {
if(errors) {console.log(errors);}
data = data.toString();
jsdom.env(data, function (errors, window) {
if(errors) {console.log(errors);}
var $ = require("jquery")(window);
$(":empty").text("{% %f %}");
fs.writeFile("home.html", $("html").html());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment