marked vs markdown-it vs turndown vs showdown vs node-html-markdown
Markdown Processing Libraries Comparison
1 Year
markedmarkdown-itturndownshowdownnode-html-markdownSimilar Packages:
What's Markdown Processing Libraries?

Markdown processing libraries are tools designed to convert Markdown text into HTML or vice versa. These libraries facilitate the integration of Markdown syntax into web applications, allowing developers to easily render formatted text and provide users with a more readable and manageable content editing experience. Each library has its unique features and capabilities, catering to different use cases in web development.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
marked11,553,07634,015968 kB2023 days agoMIT
markdown-it7,498,80819,039767 kB48a year agoMIT
turndown1,038,4409,337192 kB1349 months agoMIT
showdown748,98714,487801 kB222-MIT
node-html-markdown215,648202105 kB28-MIT
Feature Comparison: marked vs markdown-it vs turndown vs showdown vs node-html-markdown

Customization

  • marked:

    marked is less customizable compared to markdown-it, focusing on speed and simplicity. It provides a straightforward API but lacks advanced customization options, making it less suitable for highly tailored use cases.

  • markdown-it:

    markdown-it offers extensive customization options, allowing developers to define their own rules and plugins to extend the functionality. This makes it suitable for applications that require specific Markdown features or custom rendering logic.

  • turndown:

    turndown allows for some customization through rules, enabling developers to define how specific HTML elements should be converted to Markdown. This makes it more flexible than node-html-markdown.

  • showdown:

    showdown provides some level of customization through options but is not as extensible as markdown-it. It allows for basic configuration but may not meet the needs of projects requiring deep customization.

  • node-html-markdown:

    node-html-markdown is primarily focused on converting HTML to Markdown and does not offer extensive customization features. Its simplicity makes it easy to use but limits flexibility for complex scenarios.

Performance

  • marked:

    marked is known for its speed, making it one of the fastest Markdown parsers available. It is optimized for quick conversion, making it ideal for real-time applications where performance is critical.

  • markdown-it:

    markdown-it is designed for performance and can handle large documents efficiently. Its architecture allows for fast parsing and rendering, making it suitable for applications with high content volume.

  • turndown:

    turndown is efficient for converting HTML to Markdown but may not be as fast as markdown-it or marked. It is suitable for moderate use cases but may struggle with very large HTML documents.

  • showdown:

    showdown strikes a balance between performance and functionality. It is reasonably fast but may not match the speed of marked in high-load scenarios.

  • node-html-markdown:

    node-html-markdown is not optimized for performance and may be slower than other libraries when processing large HTML documents. It is best used for smaller content pieces or less frequent conversions.

Ease of Use

  • marked:

    marked is very easy to use, with a simple API that allows developers to get started quickly. It is ideal for projects where speed of implementation is a priority.

  • markdown-it:

    markdown-it has a steeper learning curve due to its extensive customization options. Developers may need to invest time in understanding its API and plugin system to fully leverage its capabilities.

  • turndown:

    turndown is also easy to use, with a clear API that simplifies the process of converting HTML to Markdown. It is beginner-friendly and requires minimal setup.

  • showdown:

    showdown offers a user-friendly API that is easy to understand, making it suitable for developers of all skill levels. Its simplicity allows for quick integration into projects.

  • node-html-markdown:

    node-html-markdown is straightforward and easy to use, making it accessible for developers who need basic HTML to Markdown conversion without additional complexity.

Community and Support

  • marked:

    marked has a solid user base and is well-documented, making it easy to find help and resources. Its simplicity contributes to a supportive community.

  • markdown-it:

    markdown-it has a strong community and a wealth of plugins available, providing good support and resources for developers looking to extend its functionality.

  • turndown:

    turndown has a growing community and good documentation, providing support for developers looking to implement HTML to Markdown conversion.

  • showdown:

    showdown enjoys a decent community and documentation, offering enough resources for developers to get assistance when needed.

  • node-html-markdown:

    node-html-markdown has a smaller community, which may result in less available support and fewer resources compared to more popular libraries.

Use Cases

  • marked:

    marked is best suited for simple Markdown rendering tasks, such as converting user-generated content in forums or chat applications where speed is essential.

  • markdown-it:

    markdown-it is ideal for applications that require complex Markdown rendering, such as blogging platforms, documentation sites, or any application needing advanced Markdown features.

  • turndown:

    turndown is specifically designed for converting HTML to Markdown, making it ideal for web scrapers or applications that need to process and store HTML content in Markdown format.

  • showdown:

    showdown is versatile and can be used in various applications that require both Markdown to HTML and HTML to Markdown conversions, making it suitable for editors and content management systems.

  • node-html-markdown:

    node-html-markdown is perfect for applications that need to store user-generated HTML content in Markdown format, such as content management systems.

How to Choose: marked vs markdown-it vs turndown vs showdown vs node-html-markdown
  • marked:

    Select marked for its speed and simplicity. It is a great choice for applications that need a straightforward Markdown-to-HTML conversion without additional overhead or complexity.

  • markdown-it:

    Choose markdown-it if you need a highly customizable Markdown parser with support for plugins and a focus on extensibility. It is ideal for projects that require advanced features like syntax highlighting or custom rendering.

  • turndown:

    Choose turndown if you need to convert HTML to Markdown. It is perfect for projects that involve scraping or processing HTML content and want to provide users with a Markdown version.

  • showdown:

    Use showdown if you are looking for a library that can easily convert Markdown to HTML and vice versa. It is particularly helpful for applications that require bidirectional conversion and a simple API.

  • node-html-markdown:

    Opt for node-html-markdown if you need to convert HTML back to Markdown. This package is useful for applications that allow users to edit content in HTML and want to store it in Markdown format for consistency.

README for marked

Marked

npm install size downloads github actions snyk

  • ⚡ built for speed
  • ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time
  • ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications
  • 🌐 works in a browser, on a server, or from a command line interface (CLI)

Demo

Checkout the demo page to see marked in action ⛹️

Docs

Our documentation pages are also rendered using marked 💯

Also read about:

Compatibility

Node.js: Only current and LTS Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.

Browser: Not IE11 :)

Installation

CLI:

npm install -g marked

In-browser:

npm install marked

Usage

Warning: 🚨 Marked does not sanitize the output HTML. Please use a sanitize library, like DOMPurify (recommended), sanitize-html or insane on the output HTML! 🚨

DOMPurify.sanitize(marked.parse(`<img src="x" onerror="alert('not happening')">`));

CLI

# Example with stdin input
$ marked -o hello.html
hello world
^D
$ cat hello.html
<p>hello world</p>
# Print all options
$ marked --help

Browser

<!doctype html>
<html>
<head>
  <meta charset="utf-8"/>
  <title>Marked in the browser</title>
</head>
<body>
  <div id="content"></div>
  <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
  <script>
    document.getElementById('content').innerHTML =
      marked.parse('# Marked in the browser\n\nRendered by **marked**.');
  </script>
</body>
</html>

or import esm module

<script type="module">
  import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
  document.getElementById('content').innerHTML =
    marked.parse('# Marked in the browser\n\nRendered by **marked**.');
</script>

License

Copyright (c) 2011-2022, Christopher Jeffrey. (MIT License)