remark

v15.0.1 MIT

markdown processor powered by plugins part of the unified collective

Weekly Downloads
3.0M
Stars
8.7K
Forks
374
Open Issues
5
Gzip Size
38.5 kB
Unpacked Size
15.7 kB
Dependencies
42
Last Updated
1y ago

remark Download Trends

Download trends for remark04.0M8.1M12.1M16.2MFeb 2025MayAugNovFebApr 2026
remark

About remark

Remark is a powerful markdown processor that transforms markdown into an Abstract Syntax Tree (AST) and provides a robust plugin system for manipulation. It addresses the need for programmatic control over markdown content, enabling developers to parse, modify, and serialize markdown text efficiently.

Built as part of the larger unified collective, remark emphasizes a composable and extensible architecture. Its core philosophy revolves around treating markdown as data, allowing for complex transformations and integrations that go beyond simple text rendering. The primary audience includes developers building content management systems, static site generators, documentation tools, or any application requiring sophisticated markdown handling.

The key API patterns involve using the `remark().process()` method, which takes markdown input and applies a sequence of plugins. Plugins are functions that receive the AST and can transform it before it's serialized back to markdown or another format. This AST-based approach, often adhering to the mdast specification, allows for precise control over every aspect of the markdown document.

Remark integrates seamlessly into various JavaScript workflows. It's commonly used with static site generators like Next.js and Gatsby, or within build tools that process markdown files. Its ability to integrate with other unified processors like `rehype` for HTML processing makes it a central piece in many content pipelines.

With 2.9 million weekly downloads and 8.7K GitHub stars, remark is a mature and widely adopted tool in the JavaScript ecosystem. Its unpacked size is a lean 15.7 kB, with a gzipped bundle size of 38.5 kB, making it an efficient choice for performance-sensitive applications. The project maintains a low open issue count, indicating a healthy and well-supported codebase.

While remark offers extensive customization, developers should be aware that complex transformations can introduce overhead. For very basic markdown rendering needs without any programmatic manipulation, a simpler markdown-to-HTML converter might suffice. However, for structured content processing and advanced use cases, remark's plugin architecture is unparalleled.

When to use

  • When programmatically transforming markdown content into an Abstract Syntax Tree (AST) for detailed manipulation.
  • When building custom markdown syntax extensions or processing specific markdown features using the `remark().use()` plugin API.
  • When integrating markdown processing into static site generators or content management systems that require structured content pipelines.
  • When generating or modifying markdown documents based on external data or predefined rules via `remark().process()`.
  • When needing to serialize markdown ASTs to HTML, by composing with `rehype` plugins for comprehensive content transformation.
  • When ensuring markdown content conforms to specific standards like CommonMark through plugins.

When NOT to use

  • If your only requirement is to convert markdown strings directly to HTML without any intermediate AST manipulation.
  • If you need to process only a few simple markdown elements and a lightweight, dedicated markdown-to-HTML parser suffices.
  • When the complexity of managing AST transformations and plugin configurations outweighs the benefits for basic text rendering.
  • If your project does not involve any dynamic modification or programmatic analysis of markdown content.
  • When working in an environment where JavaScript runtime is severely constrained and a minimal dependency footprint is paramount, and a simpler parser is available.

remark Alternatives

remark Categories