});
});
},
- // Minified test
+ // HTMLMinifier test
function (done) {
// Begin timing after gzipped fixtures have been created
var startTime = Date.now();
if (err) {
throw new Error('There was an error writing ' + minimizedFilePath);
}
+ // Gzip the minified output
gzip(minimizedFilePath, gzMinimizedFilePath, function () {
+ // Open and read the size of the minified+gzipped output
fs.stat(gzMinimizedFilePath, function (err, stats) {
if (err) {
throw new Error('There was an error reading ' + gzMinimizedFilePath);
res.on('data', function (chunk) {
response += chunk;
}).on('end', function () {
+ // Extract result from <textarea/>
var start = response.indexOf('>', response.indexOf('<textarea'));
var end = response.lastIndexOf('</textarea>');
fs.writeFile(willPeavyFilePath, response.substring(start + 1, end), {
encoding: 'utf8'
}, function () {
run([
+ // Gzip the minified output
function (done) {
gzip(willPeavyFilePath, gzWillPeavyFilePath, function () {
+ // Open and read the size of the minified+gzipped output
fs.stat(gzWillPeavyFilePath, function (err, stats) {
if (err) {
throw new Error('There was an error reading ' + gzWillPeavyFilePath);
});
});
},
+ // Open and read the size of the minified output
function (done) {
fs.stat(willPeavyFilePath, function (err, stats) {
if (err) {
encoding: 'utf8'
}, function () {
run([
+ // Gzip the minified output
function (done) {
gzip(compressFilePath, gzCompressFilePath, function () {
+ // Open and read the size of the minified+gzipped output
fs.stat(gzCompressFilePath, function (err, stats) {
if (err) {
throw new Error('There was an error reading ' + gzCompressFilePath);
});
});
},
+ // Open and read the size of the minified output
function (done) {
fs.stat(compressFilePath, function (err, stats) {
if (err) {
], done);
});
}
+ // Site refused to process content
else {
compressSize = gzCompressSize = 0;
done();