src/index.js
function readDirSync (dir, allFiles = []) {
  const files = fs.readdirSync(dir).map(f => join(dir, f))
  allFiles.push(...files)
  files.forEach(f => {
    fs.statSync(f).isDirectory() && readDirSync(f, allFiles)
  })
  return allFiles
}
function readDirSync (dir, allFiles = []) {
  const files = fs.readdirSync(dir).map(f => join(dir, f))
  allFiles.push(...files)
  files.forEach(f => {
    fs.statSync(f).isDirectory() && readDirSync(f, allFiles)
  })
  return allFiles
}
function readDirSync ( dir , allFiles = [ ] ) { const files = fs . readdirSync ( dir ) . map ( f => join ( dir , f ) ) allFiles . push ( ... files ) files . forEach ( f => { fs . statSync ( f ) . isDirectory ( ) && readDirSync ( f , allFiles ) } ) return allFiles }
Reads content directory and return all files
@param  {String} dir      Content path
@param  {Array}  allFiles Partial list of files and directories
@return {Array}           List of files and directories
Reads content directory and return all files