Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node 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 #file #exists
ADD COMMENT
Topic
Name
1+9 =