brfs-htmlmin
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -0,0 +0,0 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
@@ -0,0 +0,0 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
var fs = require('fs'); | ||
var html = fs.readFileSync(__dirname + '/doc.html', 'utf8'); | ||
console.log(html); |
20
index.js
@@ -8,2 +8,9 @@ var staticModule = require('static-module'); | ||
var regexps = [ | ||
'ignoreCustomComments', | ||
'customAttrAssign', | ||
'customAttrSurround', | ||
'customAttrCollapse' | ||
]; | ||
module.exports = function(file, opts) { | ||
@@ -22,2 +29,11 @@ if(/\.json$/.test(file)) return through(); | ||
Object.keys(opts.minify).forEach(function (key) { | ||
if(~regexps.indexOf(key)) { | ||
var value = opts.minify[key]; | ||
opts.minify[key] = Array.isArray(value) ? | ||
value.map(asRegExp) : | ||
asRegExp(value); | ||
} | ||
}); | ||
var vars = { | ||
@@ -67,2 +83,6 @@ __filename: file, | ||
} | ||
function asRegExp(val) { | ||
return (val instanceof RegExp) ? val : new RegExp(val); | ||
} | ||
}; |
{ | ||
"name": "brfs-htmlmin", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "browserify fs.readFileSync() static html file inliner with html minifier", | ||
@@ -29,3 +29,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"html-minifier": "^0.6.8", | ||
"html-minifier": "^0.7.2", | ||
"quote-stream": "0.0.0", | ||
@@ -32,0 +32,0 @@ "static-module": "^1.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
7746
87
+ Addedchange-case@2.3.1(transitive)
+ Addedclean-css@3.1.9(transitive)
+ Addedcommander@2.6.0(transitive)
+ Addedconcat-stream@1.4.11(transitive)
+ Addedhtml-minifier@0.7.2(transitive)
+ Addedlower-case-first@1.0.2(transitive)
+ Addedtypedarray@0.0.7(transitive)
- Removedchange-case@2.1.6(transitive)
- Removedclean-css@2.2.23(transitive)
- Removedcommander@2.2.0(transitive)
- Removedhtml-minifier@0.6.9(transitive)
Updatedhtml-minifier@^0.7.2