'use strict';

// MODULES //

var fs = require( 'fs' );


// FUNCTIONS //

var fcn;
if ( typeof fs.access === 'function' ) {
	fcn = fs.access;
} else {
	fcn = fs.stat;
}


// MAIN //

/**
* Tests whether a path exists on the filesystem.
*
* @param {(string|Buffer)} path - path to test
* @param {Function} clbk - callback to invoke after testing path existence
*
* @example
* exists( __dirname, done );
*
* function done( error, bool ) {
*     if ( error ) {
*         console.error( error );
*     }
*     if ( bool ) {
*         console.log( '...path exists.' );
*     } else {
*         console.log( '...path does not exist.' );
*     }
* }
*/
function exists( path, clbk ) {
	fcn( path, done );

	/**
	* Callback invoked upon performing a filesystem call.
	*
	* @private
	* @param {(Error|null)} error - error object
	*/
	function done( error ) {
		if ( clbk.length === 2 ) {
			if ( error ) {
				return clbk( error, false );
			}
			return clbk( null, true );
		}
		if ( error ) {
			return clbk( false );
		}
		return clbk( true );
	}
} // end FUNCTION exists()


// EXPORTS //

module.exports = exists;

@@ -814,16 +814,45 @@
  object%0A
+%09* @returns %7BVoid%7D undefined%0A
 %09*/%0A%09fun

Make return value explicit