bot/node_modules/npm/lib/utils/file-exists.js

11 lines
217 B
JavaScript
Raw Normal View History

2022-02-16 11:32:42 +01:00
const fs = require('fs')
const util = require('util')
const stat = util.promisify(fs.stat)
const fileExists = (file) => stat(file)
.then((stat) => stat.isFile())
.catch(() => false)
module.exports = fileExists