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>/* 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);
});

Readme

Keywords

Package Sidebar

Install

npm i html-pack

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • evanhahn