0.6.0 • Published 9 years ago

combinator v0.6.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

node-combinator

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>
<head>
    ...
    <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">
</head>
<body>
    ...
    <script type="text/javascript" src="/pooga/rooga.js"></script>
    <script type="text/javascript" src="/dooga.js"></script>
</body>

and transforms it to look like this

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

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

Install

npm -g install node-combinator

Usage

combinator -f index.html

Programmatic Usage

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

Development

To install from a clone of the source:

git clone git://github.com/tivac/node-combinator.git
cd node-combinator
npm link
0.6.0

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago