lib/index.js
function _browseDir (dir, fileList) {
  fileList || (fileList = [])

  try {
    fs.readdirSync(dir)
      .map(item => _buildFullPath(dir, item))
      .map(item => _addFileOrContinueBrowsing(item, fileList))
  } catch (e) {
    throw new Error(e.message)
  }

  return fileList
}
function _browseDir (dir, fileList) {
  fileList || (fileList = [])

  try {
    fs.readdirSync(dir)
      .map(item => _buildFullPath(dir, item))
      .map(item => _addFileOrContinueBrowsing(item, fileList))
  } catch (e) {
    throw new Error(e.message)
  }

  return fileList
}
function _browseDir ( dir , fileList ) { fileList || ( fileList = [ ] ) try { fs . readdirSync ( dir ) . map ( item => _buildFullPath ( dir , item ) ) . map ( item => _addFileOrContinueBrowsing ( item , fileList ) ) } catch ( e ) { throw new Error ( e . message ) } return fileList }
explore directories and store files in an array
@param {String} dir       directory absolute path
@param {Array.<String>} fileList   store all files
@param {Array.<String>} fileList   return all files
explore directories and store files in an array