Skip to content

Instantly share code, notes, and snippets.

@okuryu
Created October 5, 2013 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okuryu/6842437 to your computer and use it in GitHub Desktop.
Save okuryu/6842437 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
</body>
</html>
var fs = require("fs");
var YUI = require("yui").YUI;
var jsdom = require("jsdom").jsdom;
var document = jsdom(fs.readFileSync("./index.html"));
var window = document.parentWindow;
YUI({
doc: document,
win: window
}).use("node", function (Y) {
Y.log(Y.one("title").getHTML());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment