unpkg/server/utils/getFileStats.js

16 lines
277 B
JavaScript

const fs = require("fs");
function getFileStats(file) {
return new Promise((resolve, reject) => {
fs.lstat(file, (error, stats) => {
if (error) {
reject(error);
} else {
resolve(stats);
}
});
});
}
module.exports = getFileStats;