aboutsummaryrefslogtreecommitdiff
path: root/node_modules/express-minify-html/minifier.js
diff options
context:
space:
mode:
authorHumairAK <humair88@hotmail.com>2016-07-27 06:44:05 +0000
committerHumairAK <humair88@hotmail.com>2016-07-27 06:44:05 +0000
commit6fd4613d0bf1bb78340e46d45b269ddd3c36f190 (patch)
tree91a2a795aa56d96d076acf1b202645d0e68dd47a /node_modules/express-minify-html/minifier.js
parent6271b9d13139c1e55118e5f26a3a7bf8caeeb11d (diff)
added compression
Diffstat (limited to 'node_modules/express-minify-html/minifier.js')
-rw-r--r--node_modules/express-minify-html/minifier.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/node_modules/express-minify-html/minifier.js b/node_modules/express-minify-html/minifier.js
deleted file mode 100644
index 2428893..0000000
--- a/node_modules/express-minify-html/minifier.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-var minify = require('html-minifier').minify;
-
-function minifyHTML(opts) {
- if (!opts) opts = {};
-
- function minifier(req, res, next) {
-
- var sendMinified = function (callback) {
-
- // No callback specified, just minify and send to client.
- if (typeof callback === 'undefined') {
- return function (err, html) {
- if (err) {
- return next(err);
- }
-
- html = minify(html, opts.htmlMinifier);
- res.send(html);
- }
- } else {
-
- // Custom callback specified by user, use that one
- return function (err, html) {
- if (html) {
- html = minify(html, opts.htmlMinifier);
- }
-
- callback(err, html);
- }
- }
- };
-
- if (opts.override === false) {
- res.renderMin = function (view, renderOpts, callback) {
- this.render(view, renderOpts, sendMinified(callback));
- }
- } else {
- res.oldRender = res.render;
- res.render = function (view, renderOpts, callback) {
- this.oldRender(view, renderOpts, sendMinified(callback));
- };
- }
-
- return next();
- }
-
- return (minifier);
-}
-
-module.exports = minifyHTML;
-