Skip to content
inline all images, stylesheets and scripts of a webpage
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE
index.js
package.json
readme.md

readme.md

node-inline

inline all images, stylesheets and scripts of a webpage.

This is a (partial) port of remy/node-inliner to my htmlparser2 module.

installation

npm i inline

usage

var Inline = require("inline"),
    minreq = require("minreq");

minreq.get("http://feedic.com/").pipe(
  new Inline("http://feedic.com/", {
    //default options:
    images: true, //inline images
    scripts: true, //inline scripts
    stylesheets: true //inline stylesheets
  }, function(err, data){
    if(err) throw err;
    require("fs").writeFileSync("index.html", data);
  }
));

todo

inline currently doesn't minify inlined scripts & stylesheets, and also doesn't support gzip compressed sources. At least support for gzip compression is planned.


License: BSD-like

Something went wrong with that request. Please try again.