Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Expose the Uglify JS package to minify projects on the fly.
tag: release-0.2.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test/assets
.gitignore
.travis.yml
LICENSE
index.js
package.json
readme.md

readme.md

Express Uglify JS

Build Status

About

This package is designed to provide a middleware solution for on the fly compression of JavaScript files. Code for embedding stays identical so switching between development and production states is as simple as changing the config for express.

What it does

The Express Uglify middleware intercepts JS file calls and runs them through the UglifyJS package to compress and cache the files. If the file has been previously cached it just access that file on disk in a .cache directory and serves that file. All cached files are stored as xxxxx.ugly.js where xxxxx is the starting point. i.e. jquery-1.6.2.js -> jquery-1.6.2.ugly.js

To Do

  • Use ConnectJS caching API to provide proper headers
  • Comprehensive unit tests

Usage:

var expressUglify = require('express-uglify');
app.use(expressUglify.middleware({ 
  src: __dirname + '/public',
  logLevel: 'info',
  logger: new (winston.Logger)() // Specify your own winston logger or category
}));

MIT LICENSE

Something went wrong with that request. Please try again.