html-pack
0.1.0 • Public • Published HTML Pack for Node
Turns this...
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="the.css">
</head>
<body>
<script src="vendor/jquery.js"></script>
<script src="the.js"></script>
</body>
</html>
...into this (reformatted slightly):
<!DOCTYPE html><html><head><style></style><body>
<script></script></body></html>
Here's how:
var path = require("path");
var pack = require("html-pack");
pack(path.resolve(__dirname, "index.html"), function(err, html) {
console.log("index.html, inlined and minified:");
console.log(html);
});