{"id":18455,"library":"jsdoc-to-markdown","title":"jsdoc-to-markdown","description":"Generates Markdown API documentation from JSDoc-annotated JavaScript source code. Current stable version is 9.1.3, released January 2025. The library provides a CLI and a programmable API. It was the first tool to generate Markdown from JSDoc and remains the most popular. Active development with multiple releases per year; breaking changes are managed via major version bumps. Requires Node.js >=12.17. Peer dependency on @75lb/nature for theming. Notable breaking changes include removal of sync methods in v9.0.0 and removal of lodash.omit dependency in v9.1.3.","status":"active","version":"9.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/jsdoc2md/jsdoc-to-markdown","tags":["javascript","jsdoc","markdown","api","generator","js","documentation"],"install":[{"cmd":"npm install jsdoc-to-markdown","lang":"bash","label":"npm"},{"cmd":"yarn add jsdoc-to-markdown","lang":"bash","label":"yarn"},{"cmd":"pnpm add jsdoc-to-markdown","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for default output theme","package":"@75lb/nature","optional":true}],"imports":[{"note":"Default import provides the main API. CJS require works but ESM is recommended for modern Node.","wrong":"const jsdoc2md = require('jsdoc-to-markdown')","symbol":"jsdoc2md","correct":"import jsdoc2md from 'jsdoc-to-markdown'"},{"note":"render() is an async method on the default export. files must be an array, not a string.","wrong":"jsdoc2md.render({ files: 'src/*.js' })","symbol":"render","correct":"import jsdoc2md from 'jsdoc-to-markdown'; const output = await jsdoc2md.render({ files: ['src/*.js'] })"},{"note":"Returns raw JSON data before template rendering. Useful for custom templates.","wrong":"","symbol":"getTemplateData","correct":"import jsdoc2md from 'jsdoc-to-markdown'; const data = await jsdoc2md.getTemplateData({ files: ['src/*.js'] })"},{"note":"Clears the jsdoc2md cache. Not commonly needed.","wrong":"","symbol":"clear","correct":"import jsdoc2md from 'jsdoc-to-markdown'; jsdoc2md.clear()"}],"quickstart":{"code":"import jsdoc2md from 'jsdoc-to-markdown';\n\nconst output = await jsdoc2md.render({\n  files: ['example.js'],\n  'heading-depth': 2,\n});\n\nconsole.log(output);\n\n/* example.js:\n/**\n * A quite wonderful function.\n * @param {object} - Privacy gown\n * @param {object} - Security\n * @returns {survival}\n */\nfunction protection (cloak, dagger) {}\n*/","lang":"typescript","description":"Renders markdown from a single JSDoc-annotated file using the async API."},"warnings":[{"fix":"Use async/await or Promises: const output = await jsdoc2md.render({ ... })","message":"Removed renderSync(), getTemplateDataSync() and getJsdocDataSync() in v9.0.0. API is now async-only.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Always provide files (array) or source (string) input.","message":"Passing either option.files or option.source is now required in v9.0.0; previously you could omit both and it would read from stdin.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Update Node.js to version 12 or higher.","message":"Upgraded to jsdoc v4.0.0 in v8.0.0, which requires Node >=12. Minimum Node increased from v10 to v12.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Upgrade to jsdoc-to-markdown v9.1.3 or later.","message":"The render order of files specified in the 'files' array was respected prior to jsdoc-api v9.0.0 but broken by that version; sorted alphabetically instead. Fixed in jsdoc-api v9.3.5.","severity":"gotcha","affected_versions":"9.0.0 - 9.1.2"},{"fix":"No action needed; if you were relying on lodash.omit, install it explicitly.","message":"lodash.omit dependency was removed in v9.1.3. No longer needed internally.","severity":"deprecated","affected_versions":"9.1.3"},{"fix":"Upgrade to jsdoc-to-markdown v9.0.5 or later.","message":"Spaces in jsdoc binary path can cause jsdoc2md to fail. Fixed in v9.0.5.","severity":"gotcha","affected_versions":"<9.0.5"},{"fix":"Upgrade to jsdoc-to-markdown v9.0.4 or later.","message":"util.isRegExp is not a function error on Node v23 (bug in jsdoc-api). Temporary workaround in v9.0.3, permanent fix in v9.0.4.","severity":"gotcha","affected_versions":"9.0.0 - 9.0.3"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use async/await: const output = await jsdoc2md.render({ ... })","cause":"renderSync was removed in v9.0.0. The API is now async-only.","error":"TypeError: jsdoc2md.renderSync is not a function"},{"fix":"Provide files (array of paths) or source (string of code) to the render method.","cause":"In v9.0.0+, input source/files are required.","error":"Error: options.source or options.files must be defined"},{"fix":"Upgrade to jsdoc-to-markdown v9.0.4 or later.","cause":"Compatibility issue with Node v23 in older versions.","error":"util.isRegExp is not a function"},{"fix":"Upgrade to v9.0.5+ or ensure jsdoc path has no spaces.","cause":"Spaces in jsdoc path cause parsing issues in versions before v9.0.5.","error":"Error: The specified jsdoc binary path contains spaces"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}