const jsdoc2md = require('jsdoc-to-markdown'); const fs = require('fs'); const path = require('path'); const options = { "files": [ "src/modules/workbench/utils.js" ] }; const templateData = jsdoc2md.getTemplateDataSync(options); const utils = []; let entryName = "" templateData.forEach((item, index) => { if (item.name === "Dec.Utils") { utils.push(item); entryName = item.customTags.find((value, index) => { return value.tag === "entryname"; }) } if (item.memberof === "module:Dec.Utils") { utils.push(item); } }) const outputDir = __dirname; const output = jsdoc2md.renderSync({ data: utils }); fs.writeFileSync(path.resolve(outputDir, `${entryName.value}.md`), output);