Check if a file exists
🏷️ NodeJS
import { access } from "node:fs";
fs.access("file.txt", (err) => {
console.log(err ? "not exist" : "exist");
});
🏷️ NodeJS
import { access } from "node:fs";
fs.access("file.txt", (err) => {
console.log(err ? "not exist" : "exist");
});