Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Inline small JS files by finding & replacing <script src="..."> elements
JavaScript
Branch: master

readme.md

js-inliner

Build Status NPM version Dependency Status Bitdeli Badge

Inline tiny JS files into your markup without doing something gnarly.

Usage

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

inliner(stream, { root : "/fooga/wooga", size : 1024 }, function(err, text) {
    if(err) {
        throw new Error(err);
    }

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

API

inliner(stream, [options], cb)

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

Options

  • root {String} location on disk to use as the root of URLs. Default is process.cwd().
  • size {Number} maximum size in bytes of files to inline. Default is 1024.
Something went wrong with that request. Please try again.