lib/fs.js
function(p, cb)
{
  //Get the status of the path
  return fs.stat(p, function(error, stat)
  {
    //Check the error
    if(error)
    {
      //Check the error code
      if(error.code !== 'ENOENT')
      {
        //Do the callback with the error
        return cb(error, false, stat);
      }
      else
      {
        //Do the callback without error
        return cb(null, false, stat);
      }
    }

    //Do the callback with the stat
    return cb(null, true, stat);
  });
}
function(p, cb)
{
  //Get the status of the path
  return fs.stat(p, function(error, stat)
  {
    //Check the error
    if(error)
    {
      //Check the error code
      if(error.code !== 'ENOENT')
      {
        //Do the callback with the error
        return cb(error, false, stat);
      }
      else
      {
        //Do the callback without error
        return cb(null, false, stat);
      }
    }

    //Do the callback with the stat
    return cb(null, true, stat);
  });
}
function ( p , cb ) { //Get the status of the path return fs . stat ( p , function ( error , stat ) { //Check the error if ( error ) { //Check the error code if ( error . code !== 'ENOENT' ) { //Do the callback with the error return cb ( error , false , stat ) ; } else { //Do the callback without error return cb ( null , false , stat ) ; } } //Do the callback with the stat return cb ( null , true , stat ) ; } ) ; }
Check if a path exists
Check if a path exists