Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var compressJs = (function () {
var ccVersion = require('google-closure-compiler/package.json').version;
var version = ccVersion.replace(/[^\d]/, '_');
var ClosureCompiler = require('google-closure-compiler').compiler;
var crypto = require('crypto');
var fs = require('fs');
var getHash = function(filePath) {
return new Promise(function (resolve) {
var fd = fs.createReadStream(filePath);
var hash = crypto.createHash('sha256');
hash.setEncoding('hex');
fd.on('end', function () {
hash.end();
resolve(hash.read());
});
fd.pipe(hash);
});
};
var fileExists = function (filePath) {