lib/qiao.util.file.js
function getFoldersAndFiles(fpath, folders, files){
	fs.readdirSync(fpath).forEach(function(name){
		var stat = fs.statSync(fpath + name);
		if(stat.isDirectory()){
			folders.push({
				path : fpath,
				name : name
			});
			
			getFoldersAndFiles(fpath + name + '/', folders, files);
		}else{
			files.push({
				path : fpath,
				name : name
			});
		}
	});
}
function getFoldersAndFiles(fpath, folders, files){
	fs.readdirSync(fpath).forEach(function(name){
		var stat = fs.statSync(fpath + name);
		if(stat.isDirectory()){
			folders.push({
				path : fpath,
				name : name
			});
			
			getFoldersAndFiles(fpath + name + '/', folders, files);
		}else{
			files.push({
				path : fpath,
				name : name
			});
		}
	});
}
function getFoldersAndFiles ( fpath , folders , files ) { fs . readdirSync ( fpath ) . forEach ( function ( name ) { var stat = fs . statSync ( fpath + name ) ; if ( stat . isDirectory ( ) ) { folders . push ( { path : fpath , name : name } ) ; getFoldersAndFiles ( fpath + name + '/' , folders , files ) ; } else { files . push ( { path : fpath , name : name } ) ; } } ) ; }
get folders and files
get folders and files