UNPKG

rjweb-server

Version:

Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS

9 lines (8 loc) 227 B
import fs from "fs"; export async function fileExists(path) { return new Promise((resolve) => { fs.stat(path, (err, stats) => { resolve(!err && (stats.isFile() || stats.isFIFO())); }); }); }