unpkg/server/middleware/utils/getFileStats.js

16 lines
271 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