Gruntfile.js
function () {
		var cwd = process.cwd();
		var rootPath = cwd;
		var newRootPath = null;
		while (!fs.existsSync(path.join(process.cwd(), "node_modules/grunt"))) {
			process.chdir("..");
			newRootPath = process.cwd();
			if (newRootPath === rootPath) {
				return;
			}
			rootPath = newRootPath;
		}
		process.chdir(cwd);
		return rootPath;
	}
function () {
		var cwd = process.cwd();
		var rootPath = cwd;
		var newRootPath = null;
		while (!fs.existsSync(path.join(process.cwd(), "node_modules/grunt"))) {
			process.chdir("..");
			newRootPath = process.cwd();
			if (newRootPath === rootPath) {
				return;
			}
			rootPath = newRootPath;
		}
		process.chdir(cwd);
		return rootPath;
	}
function ( ) { var cwd = process . cwd ( ) ; var rootPath = cwd ; var newRootPath = null ; while ( ! fs . existsSync ( path . join ( process . cwd ( ) , "node_modules/grunt" ) ) ) { process . chdir ( ".." ) ; newRootPath = process . cwd ( ) ; if ( newRootPath === rootPath ) { return ; } rootPath = newRootPath ; } process . chdir ( cwd ) ; return rootPath ; }
Function that find the root path where grunt plugins are installed.

@method findRoot
@return String rootPath
Function that find the root path where grunt plugins are installed .