src/indexOld.js
function _getFiles(path){
        let files = [];
        fs.readdirSync(path).forEach(function(file){
            let subpath = path + '/' + file;
            if(fs.lstatSync(subpath).isDirectory()){
                let filesReturned = _getFiles(subpath);
                files = files.concat(filesReturned);
            } else {
                files.push(path + '/' + file);
            }
        });
        return files;
    }
function _getFiles(path){
        let files = [];
        fs.readdirSync(path).forEach(function(file){
            let subpath = path + '/' + file;
            if(fs.lstatSync(subpath).isDirectory()){
                let filesReturned = _getFiles(subpath);
                files = files.concat(filesReturned);
            } else {
                files.push(path + '/' + file);
            }
        });
        return files;
    }
function _getFiles ( path ) { let files = [ ] ; fs . readdirSync ( path ) . forEach ( function ( file ) { let subpath = path + '/' + file ; if ( fs . lstatSync ( subpath ) . isDirectory ( ) ) { let filesReturned = _getFiles ( subpath ) ; files = files . concat ( filesReturned ) ; } else { files . push ( path + '/' + file ) ; } } ) ; return files ; }
Recursively gather the paths of the files inside a directory path
@method _getFiles
@param {String} path The directory path to search
@returns {Array} An Array of file paths belonging to the directory path provided
Recursively gather the paths of the files inside a directory path