mineverything

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i mineverything

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • appisode