{"id":18526,"library":"markmap-cli","title":"markmap-cli","description":"markmap-cli v0.18.12 is a command-line tool to convert Markdown files into interactive mind maps (markmaps). It uses the markmap library to parse Markdown and generate HTML output. This version requires Node.js >=18 and is ESM-only (no CommonJS support). Drop-in replacement for generating mindmap HTML from Markdown files. Frequently updated, with breaking changes in recent versions including async setData, INode type changes, and migration from Prism.js to highlight.js.","status":"active","version":"0.18.12","language":"javascript","source_language":"en","source_url":"https://github.com/markmap/markmap","tags":["javascript","markmap","markdown","mindmap","typescript"],"install":[{"cmd":"npm install markmap-cli","lang":"bash","label":"npm"},{"cmd":"yarn add markmap-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add markmap-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core library for transforming Markdown to mindmap data","package":"markmap-lib","optional":false},{"reason":"Renders the mindmap in the browser when generating HTML","package":"markmap-view","optional":false}],"imports":[{"note":"Package name is markmap-cli, but the binary is markmap. Use npx markmap.","wrong":"npx markmap input.md","symbol":"default (CLI)","correct":"npx markmap-cli input.md"},{"note":"ESM-only since v0.15.0. CommonJS require() will throw.","wrong":"const markmap = require('markmap-cli')","symbol":"default (programmatic)","correct":"import markmap from 'markmap-cli'"},{"note":"INode type is exported from markmap-common, not markmap-cli.","wrong":"import { INode } from 'markmap-cli'","symbol":"INode","correct":"import { INode } from 'markmap-common'"}],"quickstart":{"code":"npx markmap-cli@0.18.12 README.md -o mindmap.html","lang":"javascript","description":"Generates an interactive mindmap HTML from a Markdown file using the CLI."},"warnings":[{"fix":"Update code to use INode type from markmap-common instead of FlextreeNode<INode>.","message":"Node data type changed to INode (breaking in v0.18.0)","severity":"breaking","affected_versions":">=0.18.0"},{"fix":"Await the promise returned by mm.setData() before accessing rendered DOM.","message":"setData is now asynchronous (breaking in v0.18.0)","severity":"breaking","affected_versions":">=0.18.0"},{"fix":"Update any syntax highlighting plugins or configuration to use highlight.js instead of Prism.","message":"Switched from Prism.js to highlight.js (breaking in v0.15.0)","severity":"breaking","affected_versions":">=0.15.0"},{"fix":"Use ESM imports (import syntax) instead of require(). Project must have type: module or use .mjs extensions.","message":"Dropped CJS support (breaking in v0.15.0)","severity":"breaking","affected_versions":">=0.15.0"},{"fix":"Use highlight.js compatible themes and configuration. Prism-specific plugins will not work.","message":"Prism.js removed in v0.15.0, highlighting is now highlight.js","severity":"deprecated","affected_versions":">=0.15.0"},{"fix":"Ensure your environment supports ESM (e.g., type:module in package.json).","message":"Script must be run as a module or with top-level await for async operations","severity":"gotcha","affected_versions":">=0.18.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import syntax: import markmap from 'markmap-cli' instead of require().","cause":"Attempting to require the ESM-only package using CommonJS require()","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'markmap-cli'"},{"fix":"Add await before mm.setData() call.","cause":"Using setData without await after v0.18.0","error":"TypeError: Cannot read properties of undefined (reading 'props')"},{"fix":"Update to v0.15.0 or later to use --offline flag.","cause":"Using an older version of markmap-cli that did not have the offline option (added in v0.15.0)","error":"Option '--offline' is not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}