mdast-util-gfm

Composes five mdast GitHub Flavored Markdown extensions into one parser and serializer for autolinks, footnotes, tables, strikethrough, and tasklists.

Library
npm
v3.1.0
24stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
26/100Needs Attention
Development Activity0
Maintenance20
Community12
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
61/100Good
Architecture75
Code Quality85
Innovation40
Learning Curve45

mdast-util-gfm is a small aggregator package from the syntax-tree/unified collective that bundles GitHub Flavored Markdown (GFM) support into mdast, the markdown abstract syntax tree used across the unified/remark ecosystem. Rather than implementing GFM parsing itself, it composes five sibling extension packages — autolink literals, footnotes, strikethrough, tables, and tasklists — behind two functions, gfmFromMarkdown() and gfmToMarkdown(options), that plug directly into mdast-util-from-markdown and mdast-util-to-markdown.

It is the same GFM layer that powers remark-gfm, so projects that need the individual mdast-util-from-markdown/to-markdown building blocks (rather than remark’s higher-level plugin API) can pull in this one package instead of wiring the five extensions together by hand. It must be paired with micromark-extension-gfm for the underlying token-level parsing; this package only handles the mdast (tree) layer.

What You Get

  • gfmFromMarkdown() — a ready-made array of mdast-util-from-markdown extensions enabling all five GFM syntaxes at once
  • gfmToMarkdown(options) — a matching to-markdown extension for serializing GFM mdast nodes back into markdown text
  • Table serialization options (tablePipeAlign, tableCellPadding, stringLength) forwarded from mdast-util-gfm-table
  • Footnote serialization options (firstLineBlank) forwarded from mdast-util-gfm-footnote
  • Full TypeScript types via JSDoc, with an exported Options interface merging the footnote and table option types

Common Use Cases

  • Building a custom markdown processor on mdast-util-from-markdown/to-markdown that needs GFM without adopting the full remark plugin pipeline
  • Parsing GitHub-flavored README/issue/PR content into an mdast tree for static-site generators or documentation tooling
  • Round-tripping markdown (parse then re-serialize) while preserving GFM constructs like tables and tasklists
  • Rendering GFM markdown to HTML by parsing with gfmFromMarkdown() and transforming the resulting mdast with mdast-util-to-hast

Under The Hood

Architecture The package is a thin composition/façade layer: index.js re-exports lib/index.js, whose entire logic is two functions, gfmFromMarkdown() and gfmToMarkdown(options), that call into and aggregate the extension objects returned by five sibling mdast-util-gfm-* packages (autolink-literal, footnote, strikethrough, table, task-list-item) into the array/object shapes mdast-util-from-markdown and mdast-util-to-markdown expect. There is no branching, state, or internal abstraction beyond delegation, so the architecture’s only real dependency risk is staying in lockstep with the extension contract of its five siblings and of mdast-util-from-markdown/to-markdown itself.

Tech Stack Written as ESM-only JavaScript (type: module) targeting Node.js 16+, with no runtime bundler — it ships raw source and relies on JSDoc-derived TypeScript declarations (index.d.ts) built separately via tsc and enforced with 100%-strict type-coverage. Its production dependencies are exactly the five mdast-util-gfm-* extension packages plus mdast-util-from-markdown and mdast-util-to-markdown; devDependencies bring in xo (ESLint) and prettier for linting/formatting, remark-cli with remark-preset-wooorm for self-linting the README, micromark-extension-gfm and mdast-util-to-hast/hast-util-to-html for integration-testing the full parse-to-HTML round trip, and c8 plus Node’s built-in test runner for coverage.

Code Quality test/index.js drives a CommonMark/GFM-style fixture table (test/spec.js) through fromMarkdown → toHast → toHtml and through toMarkdown, comparing output against golden fixtures under test/fixture/ for both HTML rendering and markdown round-tripping, plus dedicated tests for footnote and table serialization options. Coverage is enforced with c8 —100, type coverage is enforced at 100% strict, and CI (GitHub Actions) runs the suite across multiple Node versions with codecov reporting. Because the package itself contains almost no logic, testing is necessarily integration-style against the composed extensions rather than unit-style against internal branches.

API Design The public surface is deliberately minimal — exactly two named exports, gfmFromMarkdown() (no arguments) and gfmToMarkdown(options?) — which makes onboarding nearly instant for anyone already using mdast-util-from-markdown/to-markdown: drop the extension arrays into the existing extensions/mdastExtensions options and GFM support is enabled. The one merged Options type (combining the footnote and table option interfaces) keeps configuration discoverable without needing to know which sub-package a given option originated from.

Used by 6 apps in this directory

TypeScript
75%
Apache 2.0

Fern

Developer Tools

3,772

Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.

View details
90
Repo Health
86
Technical
66
Dependency
Built with
TypeScript75%
Updated yesterday
TypeScript
81%
MIT

LibreChat

Developer Tools · AI Assistants

42,871

Unite every major AI model in one self-hosted chat platform with agents, code execution, MCP tools, and enterprise authentication.

View details
93
Repo Health
81
Technical
65
Dependency
Built with
TypeScript81%
JavaScript18%
Updated today
Go
51%
MIT

memos

Note Taking

62,805

Open-source, self-hosted note-taking built for quick capture — Markdown-native, lightweight, and fully yours.

View details
91
Repo Health
78
Technical
66
Dependency
Built with
Go51%
TypeScript48%
Updated yesterday
TypeScript
94%
Apache 2.0

OneUptime

Monitoring

7,563

The complete open-source observability platform that replaces PagerDuty, Datadog, Sentry, and StatusPage with a single self-hostable system.

View details
90
Repo Health
81
Technical
65
Dependency
Built with
TypeScript94%
Updated today
TypeScript
71%
Apache 2.0

Supabase

Developer Tools · Databases · Search

108,912

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript71%
MDX26%
Updated today
TypeScript
98%
Apache 2.0

TinaCMS

CMS

13,780

An open-source, Git-backed headless CMS that gives editors a live visual editing UI over Markdown, MDX, JSON, and YAML content while developers keep everything in version control.

View details
92
Repo Health
74
Technical
59
Dependency
Built with
TypeScript98%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search