I only want to know whether a path exists. Here's my code:
var path = require('path'); // exists path
try:
var path = require('path');
if (path.existsSync("/the/path")) { // or fs.existsSync
// ...
}
or
fs.exists('/the/path', function (exists) {
util.debug(exists ? "it's there" : "no exists");
});