Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Prefix /urls/like/this in your html with a CDN URL

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitattributes
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .jshintrc
Octocat-spinner-32 .npmignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 package.json
Octocat-spinner-32 readme.md
readme.md

html-prefixer

Build Status NPM version Dependency Status Bitdeli Badge

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

Usage

var prefixer = require("html-prefixer");

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

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

API

prefixer(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.

A Note on Versioning

This project's version number currently has a "0.x" prefix, indicating that it's a new project under heavy development. As long as the version number starts with "0.x", minor revisions may introduce breaking changes. You've been warned!

Once it reaches version 1.0.0, it will adhere strictly to SemVer 2.0.

Something went wrong with that request. Please try again.