html-prefixer

Prefix urls in <script>/<link>/<img> with a cdn URL

npm install html-prefixer
1 downloads in the last week
5 downloads in the last month

HTML Prefixer

Prefix URLs in <script>/<link>/<img> with a cdn URL

Build Status NPM version Dependency Status

Usage

var inliner = require("js-inliner");

prefix(stream, { prefix : "//abcdefg123.cloudfront.net" }, function(err, text) {
    if(err) {
        throw new Error(err);
    }

    console.log(text.toString("utf8"));
});

API

prefix(stream, [options], cb)

  • stream {Stream} Readable stream to parse
  • options {Object}
  • cb {Function}
    • err {Error | null}
    • text {Buffer} Rewritten text

Options

  • prefix {String} URL used to prefix elements.
npm loves you