🛠️
Utility8M+/wkMIT

marked

Marked is a fast, low-level Markdown parser and compiler built for speed, providing a simple API for converting Markdown text to HTML. The library supports the

Installation

npm
npm install marked
yarn
yarn add marked
pnpm
pnpm add marked

Import

ESM
import { marked } from 'marked';

Quick Example

usage
import { marked } from 'marked';

const markdown = '# Hello\n\nThis is **bold** and *italic*.';
const html = marked(markdown);
console.log(html);
// '<h1>Hello</h1>\n<p>This is <strong>bold</strong> and <em>italic</em>.</p>'

About marked

Marked is a fast, low-level Markdown parser and compiler built for speed, providing a simple API for converting Markdown text to HTML. The library supports the full CommonMark specification plus GitHub Flavored Markdown (GFM) extensions including tables, task lists, strikethrough, and autolinks. Marked achieves its speed by using a single-pass lexer/parser architecture without caching or complex AST manipulation. The library provides extension points through custom renderers that override how specific Markdown elements are converted to HTML, custom tokenizers for adding new syntax, and walkTokens for post-processing the token stream. Marked handles code blocks with language detection for syntax highlighting integration, smartypants for typographic quotes and dashes, and configurable sanitization for security when rendering user-provided Markdown. The library works in both Node.js and browser environments with the same API. Marked is used by documentation generators, CMS platforms, comment systems, and any application that needs Markdown rendering. While unified/remark provides more extensible Markdown processing through AST manipulation, Marked remains the go-to choice when simplicity and speed are the primary concerns.

Quick Facts

Packagemarked
CategoryUtility
Weekly Downloads8M+
LicenseMIT
Installnpm install marked

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.