function rootDir() {
	var path;
	if ( ROOT_DIR ) {
		return ROOT_DIR;
	}
	path = resolveParentPathBy( 'package.json', OPTS, predicate );
	if ( path === null ) {
		throw new Error( 'unexpected error. Unable to resolve root project directory.' );
	}
	ROOT_DIR = dirname( path );
	return ROOT_DIR;
}
Synchronously resolves the root project directory.

@throws {Error} unable to resolve root project directory
@returns {(string|null)} path of root project directory

@example
var path = rootDir();
// returns '...'