How to use the stats function from fs

Find comprehensive JavaScript fs.stats code examples handpicked from public code repositorys.

8123
8124
8125
8126
8127
8128
8129
8130
8131
8132

href = path.join(dir, file);
let file_obj = {};

// let stats = fs.statSync(href);
fs.stats(href, (err, stats) => {

    file_obj.href = href;
    file_obj.mtime = stats.mtime;
    file_obj.ctime = stats.ctime;
fork icon2
star icon5
watch icon1