Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function compareFile(a, b) {
const streamA = new util.HashStream();
const streamB = new util.HashStream();
return Promise.all([
pipeStream(fs.createReadStream(a), streamA),
pipeStream(fs.createReadStream(b), streamB)
]).then(() => streamA.read().equals(streamB.read()));
}
function compareFile(a, b) {
const streamA = new util.HashStream();
const streamB = new util.HashStream();
return Promise.all([
pipeStream(fs.createReadStream(a), streamA),
pipeStream(fs.createReadStream(b), streamB)
]).then(() => streamA.read().equals(streamB.read()));
}
return new Promise((resolve, reject) => {
cos.putObject({
Bucket: config.bucket,
Region: config.region,
Key: file,
Body: fs.createReadStream(filePath),
ContentLength: fs.statSync(filePath).size,
onProgress: function (progressData) {
//console.log(JSON.stringify(progressData));
},
}, (err, data) => {
if (err) {
reject(err);
} else {
resolve(data);
}
})
})
}
data.data = () => fs.createReadStream(source);
}
data: () => fs.createReadStream(path.join(prismLineNumbersPluginDir, 'prism-line-numbers.min.js'))
});
data: () => fs.createReadStream(prismThemeFilePath)
}];
return new Promise((resolve, reject) => {
cos.putObject({
Bucket: config.Bucket,
Region: config.Region,
Key: file.name,
Body: fs.createReadStream(file.path)
}, (err, data) => {
if (err) {
reject(err)
} else {
resolve(data)
}
})
})
}
data: function() {
return fs.createReadStream(filePath);
}
}
'data': () => fs.createReadStream(path.resolve(__dirname, './lib/blog-encrypt.js')),
'path': 'lib/blog-encrypt.js',