Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node check if file exists

const fs = require("fs"); // Or `import fs from "fs";` with ESM
if (fs.existsSync(path)) {
    // Do something
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #node #check #file #exists
ADD COMMENT
Topic
Name
4+9 =