function getAllFiles (dir) {
  return fs.readdirSync(dir).reduce(function (files, file) {
    const name = path.join(dir, file)
    const isDirectory = fs.statSync(name).isDirectory()
    return isDirectory
      ? files.concat(getAllFiles(name))
      : files.concat([name])
  }, [])
}
Find all files inside a dir, recursively.
Source: https://gist.github.com/kethinov/6658166#gistcomment-2389484
@function getAllFiles
@param  {string} dir Dir path string.
@return {string[]} Array with all file names that are inside the directory.