packageNameFromDir = (fs, dirName, filePath) => {
  const packageFile = path.join(dirName, 'package.json') // if the directory contains a package.json, try that one
  if (fs.existsSync(packageFile)) {
    const name = JSON.parse(fs.readFileSync(packageFile)).name
    if (name) {
      return name
    }
  }
  return filePath ? parsePath(path.basename(filePath)).name : path.basename(dirName)
}
attempt to extract a package name from a directory
@param  {} fs
@param  {} dirName
@param  {} filePath