code: function readGitignore(directory) {
    const gitignorePath = `${directory}/.gitignore`
    try {
      const gitignoreRaw = fs.readFileSync(gitignorePath, 'utf-8')
      const gitignoreList = gitignoreRaw.split('\n')
        .filter(function (line) {
          return line !== '' && !line.startsWith('#')
        })
        .map(function (line) {
          // lines such as `/node_modules` in `.gitignore` are not used
          // the same way by minimatch. In order for the matching to work
          // we need to remove the starting `/`
          return line.startsWith('/') ? line.slice(1) : line
        })
      return gitignoreList
    } catch (e) {
      return []
    }
  }
docs: If available, it reads the `.gitignore` file in the current
  directory and parses it into a list of glob patterns, removing
  empty lines and comments