import fs from 'fs'
if (fs.existsSync(path)) {
// Do something
}
const fs = require("fs")
fs.access("./directory-name", function(error) {
if (error) {
console.log("Directory does not exist.")
} else {
console.log("Directory exists.")
}
})
const { exists } = require("fs");
var fs = require( 'fs' ),
path = require( 'path' ),
expect = require( 'expect' ),
exists(path.join(__dirname, "
ode_modules.bin"), (e) => {
console.log(e ? "
ode_modules.bin exists" : "
Install missing packages
");
});