How to use the utimesSync function from fs-extra

Find comprehensive JavaScript fs-extra.utimesSync code examples handpicked from public code repositorys.

60
61
62
63
64
65
66
67
68
    }
    fs.chmodSync(output, stat.mode)


    if (options.preserve) {
        fs.chownSync(output, stat.uid, stat.gid)
        fs.utimesSync(output, stat.atime, stat.mtime)
    }
}
fork icon3
star icon28
watch icon0

37
38
39
40
41
42
43
44
45
46
47
        console.debug(`cp ${from} ${to}`)
        try {
            fs.mkdirSync(path.dirname(to))
        } catch {}
        fs.copyFileSync(from, to)
        fs.utimesSync(to, new Date(), new Date(fromT))
    }
}


const args = process.argv.slice(2)
fork icon4
star icon24
watch icon9

60
61
62
63
64
65
66
67
68
69
70
}


const updateFileUTimesIfOverrideIsNewer = (original, override) => {
  if (isOverrideNewer(original, override)) {
    const date = new Date()
    fs.utimesSync(original, date, date)
    console.log(original + ' is touched.')
  }
}

fork icon0
star icon0
watch icon1

+ 5 other calls in file

175
176
177
178
179
180
181
182
183
184
    }
}
function updateTimes(path, atime, mtime) {
    if (exists(path)) {
        const normalizedPath = (0, path_1.normalize)(path);
        fs.utimesSync((0, path_1.normalize)(path), atime, mtime);
        // update cache
        if (readStatsCache.has(normalizedPath)) {
            readStatsCache.delete(normalizedPath);
        }
fork icon0
star icon0
watch icon1

+ 14 other calls in file

function icon

fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)