Check if a path is a file in Node.js using Promises. Returns false on error, also serving as an existence check.
import fs from "node:fs/promises";
function isFile(path: string): Promise<boolean> { return fs .stat(path) .then((stats) => stats.isFile()) .catch(() => false);}
hsb.horse