Skip to content

Quick Start

Markdom is a fast, customizable Markdown-to-HTML parser. You can use it via the Node.js API or through the CLI for your Markdown conversion needs.

To use Markdom programmatically, follow this simple example:

import { markdom } from '@tenedev/markdom';
const md = '# Hello World';
const { html, toc } = markdom.parse(md);
console.log(html, toc);
  • html: The generated HTML from the provided Markdown.
  • toc: A Table of Contents (TOC) based on the headings in the Markdown.

To use Markdom through the command line, run the following:

Terminal window
npx @tenedev/markdom README.md -o output.html

This will convert the README.md file to HTML and save it as output.html.

  • Node.js version 16 or higher is required for both the Node.js API and the CLI.