1.0.1 • Published 8 years ago

mineverything v1.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
8 years ago

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: "."