Рефакторинг

This commit is contained in:
Book Pauk
2019-02-05 15:58:12 +07:00
parent ae744fb80f
commit d62b475fdd
3 changed files with 11 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
const fs = require('fs-extra');
const crypto = require('crypto');
function sleep(ms) {
@@ -8,7 +9,12 @@ function randomHexString(len) {
return crypto.randomBytes(len).toString('hex')
}
async function touchFile(filename) {
await fs.utimes(filename, Date.now()/1000, Date.now()/1000);
}
module.exports = {
sleep,
randomHexString
randomHexString,
touchFile
};