MCPcopy Index your code
hub / github.com/kangax/html-minifier / processFile

Function processFile

cli.js:230–248  ·  view source on GitHub ↗
(inputFile, outputFile)

Source from the content-addressed store, hash-verified

228}
229
230function processFile(inputFile, outputFile) {
231 fs.readFile(inputFile, { encoding: 'utf8' }, function(err, data) {
232 if (err) {
233 fatal('Cannot read ' + inputFile + '\n' + err.message);
234 }
235 var minified;
236 try {
237 minified = minify(data, createOptions());
238 }
239 catch (e) {
240 fatal('Minification error on ' + inputFile + '\n' + e.message);
241 }
242 fs.writeFile(outputFile, minified, { encoding: 'utf8' }, function(err) {
243 if (err) {
244 fatal('Cannot write ' + outputFile + '\n' + err.message);
245 }
246 });
247 });
248}
249
250function processDirectory(inputDir, outputDir, fileExt) {
251 fs.readdir(inputDir, function(err, files) {

Callers 1

processDirectoryFunction · 0.70

Calls 3

fatalFunction · 0.85
createOptionsFunction · 0.85
minifyFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…