code: function createIndex(dirPath) {
      const dirName = path.basename(dirPath)
      return format(`/** DON'T EDIT THIS FILE; was created by scripts. */
      "use strict"
  
      module.exports = {
          ${fs
              .readdirSync(dirPath)
              .map(file => path.basename(file, ".js"))
              .map(id => `"${id}": require("./${dirName}/${id}"),`)
              .join("\n    ")}
      }
      `)
  }
docs: Create the index file content of a given directory.
  @param {string} dirPath The path to the directory to create index.
  @returns {string} The index file content.