node-html-markdown is a high-performance, cross-platform library designed for converting HTML content into Markdown, compatible with both Node.js and browser environments. The current stable version is 2.0.0. The library's primary focus is on speed, with benchmarks indicating significantly faster conversion rates compared to popular alternatives like Turndown. Additionally, it emphasizes generating human-readable Markdown output by producing clean, concise results with consistent spacing, aiming to avoid common formatting issues such as excessive line breaks. While it does not adhere to a rigid release schedule, the project is actively maintained, with regular updates that have historically included features like table support and fixes for browser compatibility, ensuring its reliability for converting large volumes of HTML data.
npm install node-html-markdownVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing a reusable instance of `NodeHtmlMarkdown` with custom options and using it to convert both single and multiple HTML strings to Markdown efficiently.
Review HTML input for elements inside code blocks that might have previously been implicitly handled. Adjust HTML or use custom translators if specific parsing behavior for these elements is desired within code blocks.
Always create a single `new NodeHtmlMarkdown()` instance and reuse it for all subsequent `translate()` calls in performance-critical applications or when converting many HTML strings.
When running in a browser, initialize `NodeHtmlMarkdown` with `{ preferNativeParser: true }` in the options object to utilize the browser's native HTML parsing capabilities.Ensure your Node.js environment is upgraded to version 20.0.0 or newer. Check your `package.json` engines field and update CI/CD configurations accordingly.
No dependency data recorded yet.