node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

mineverything

mineverything

About

mineverything is a middleware (read: layer) between ExpressJS and minification libraries like uglify-js and uglifycss.

Usage

Practical

var express = require('express');
var mineverything = require('mineverything');
var app = express();
app.use('/js', mineverything({ sourcePath: 'web/js', type: 'js' }));
// http://localhost/js/anyfile.js will be automatically served as minified. 
app.use('/css', mineverything({ sourcePath: 'web/css', type: 'css' }));
// http://localhost/css/anyfile.css will be automatically served as minified. 
app.listen(80);

Abstract

mineverything(options); // returns middleware 

Options

type

Possible values: "js" and "css" Defaults to: js

minifiedSuffix

I.e.: ".minified.js" Defaults to: ".minified.[type]"

sourcePath

Relative to the directory in which the main application is contained. I.e.: "web/js" Defaults to: "."