function readDirectory (srcDir) {
  let srcTree = {}
  const entries = fs.readdirSync(srcDir)

  entries.forEach(function (entry) {
    const filePath = path.join(srcDir, entry)
    if (fs.lstatSync(filePath).isDirectory()) {
      srcTree[entry] = readDirectory(filePath)
    } else {
      srcTree[entry] = fs.readFileSync(filePath, {
        encoding: 'utf8'
      })
    }
  })

  return srcTree
}
/**
 * reads a directory into an object
 * @param {String} srcDir - source directory
 * @returns {Object} an object containing the directory file contents
 */
reads a directory into an object
@param {String} srcDir - source directory
@returns {Object} an object containing the directory file contents
reads a directory into an object @param { String } srcDir - source directory @returns { Object } an object containing the directory file contents
function readDirectory (srcDir) {
  let srcTree = {}
  const entries = fs.readdirSync(srcDir)
  entries.forEach(function (entry) {
    const filePath = path.join(srcDir, entry)
    if (fs.lstatSync(filePath).isDirectory()) {
      srcTree[entry] = readDirectory(filePath)
    } else {
      srcTree[entry] = fs.readFileSync(filePath, {
        encoding: 'utf8'
      })
    }
  })
  return srcTree
}
function readDirectory ( srcDir ) { let srcTree = { } const entries = fs . readdirSync ( srcDir ) entries . forEach ( function ( entry ) { const filePath = path . join ( srcDir , entry ) if ( fs . lstatSync ( filePath ) . isDirectory ( ) ) { srcTree [ entry ] = readDirectory ( filePath ) } else { srcTree [ entry ] = fs . readFileSync ( filePath , { encoding : 'utf8' } ) } } ) return srcTree }
reads a directory into an object
 @param {String} srcDir - source directory
 @returns {Object} an object containing the directory file contents
reads a directory into an object @param { String } srcDir - source directory @returns { Object } an object containing the directory file contents