Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (24 sloc) 1.18 kB

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.
Jump to Line
Something went wrong with that request. Please try again.