code: function parseFromDir(dir) {
    if (!dir) {
      throw new Error('The app directory must be passed to read JSON files.');
    }
    if (!FileUtils.doesDirectoryExist(dir)) {
      throw new Error(`The passed directory '${dir}' must exist and must be a directory to read JSON files.`);
    }
    const entityDir = `${dir}/.jhipster`;
    if (!FileUtils.doesDirectoryExist(entityDir)) {
      throw new Error(`'${entityDir}' must exist as a directory.`);
    }
    const entities = {};
    const files = fs.readdirSync(entityDir);
    files.forEach(file => {
      if (file.endsWith('.json')) {
        const entityName = file.slice(0, file.length - 5);
        try {
          entities[entityName] = JSONFileReader.readEntityJSON(`${entityDir}/${file}`);
        } catch (error) {
          // Not an entity file, not adding
        }
      }
    });
    const jdl = convertServerOptionsToJDL(JSONFileReader.readEntityJSON(`${dir}/.yo-rc.json`)['generator-jhipster']);
    convertEntitiesToJDL(entities, jdl);
    return jdl;
  }
docs: /* Parse the given jhipster app dir and return a JDLObject