Fetching contributors…
Cannot retrieve contributors at this time
72 lines (54 sloc) 1.94 KB


Build Status NPM version Dependency Status devDependency Status

Console script to find repeated <script> or <link> elements and streamline them into a single element using a combo handler

Takes HTML that looks like this

<!DOCTYPE html>
    <link rel="stylesheet" type="text/css" href="/fooga.css">
    <link rel="stylesheet" type="text/css" href="/wooga/booga.css">
    <link rel="stylesheet" type="text/css" href="/tooga/looga.css">
    <script type="text/javascript" src="/pooga/rooga.js"></script>
    <script type="text/javascript" src="/dooga.js"></script>

and transforms it to look like this

<!DOCTYPE html>
    <link rel="stylesheet" type="text/css" href="/combo?/fooga.css&/wooga/booga.css&/tooga/looga.css">
    <script type="text/javascript" src="/combo?/pooga/rooga.js&/dooga.js"></script>

saving HTTP requests, bytes over the wire, and possibly your sanity (unlikely).


npm -g install node-combinator


combinator -f index.html

Programmatic Usage

var Combinator = require("combinator"),
    combinator = new Combinator({
        src : "<!DOCTYPE html>"
    });, html) {
    // html is optimized output


To install from a clone of the source:

git clone git://
cd node-combinator
npm link