mirror of
https://github.com/nodejs/node.git
synced 2025-05-22 02:23:34 +00:00

PR-URL: https://github.com/nodejs/node/pull/35576 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
9 lines
211 B
JavaScript
9 lines
211 B
JavaScript
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
|