inline styles and scripts and minify everything
JavaScript CoffeeScript CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
LICENSE.txt
README.md
index.js
package.json

README.md

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>/* contents of the.css, minified */</style><body>
<script>/* contents of jquery then contents of the.js, minified */</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);
});

Not incredibly robust, so pull requests are welcome!