# @davidwells/md-utils

> Simple MD utils

Latest version **0.0.64** (published 2026-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @davidwells/md-utils
pnpm add @davidwells/md-utils
yarn add @davidwells/md-utils
bun add @davidwells/md-utils
```

## Health

**Score 55/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.64 |
| Published | 2026-07-29 |
| First published | 2023-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | David Wells |
| Maintainers | davidwells |

## Links

- npm: https://www.npmjs.com/package/@davidwells/md-utils
- Repository: https://github.com/DavidWells/components/packages/util-md
- npm.io page: https://npm.io/package/@davidwells/md-utils

## Dependencies (3)

- [oparser](https://npm.io/package/oparser.md) ^3.0.1
- [gray-matter](https://npm.io/package/gray-matter.md) ^4.0.3
- [micro-mdx-parser](https://npm.io/package/micro-mdx-parser.md) ^1.1.1

## Recent versions

- 0.0.64 (latest) — 2026-07-29
- 0.0.62 — 2026-07-22
- 0.0.61 — 2026-07-18
- 0.0.60 — 2026-07-15
- 0.0.59 — 2026-07-15
- 0.0.58 — 2026-07-15
- 0.0.57 — 2026-07-15
- 0.0.56 — 2026-07-07
- 0.0.54 — 2026-06-20
- 0.0.53 — 2025-06-24
- 0.0.52 — 2025-04-24
- 0.0.51 — 2025-04-21
- 0.0.50 — 2025-04-21
- 0.0.49 — 2025-04-19
- 0.0.48 — 2025-04-19
- … 47 more at https://npm.io/package/@davidwells/md-utils/versions

## README

# Markdown utils

Markdown utilities

## Install

```
npm install @davidwells/md-utils
```

## Which parser should I import?

`parseMarkdown` is the full, all-inclusive parser. It is intentionally bigger
because it includes frontmatter parsing, AST parsing, TOC generation, links,
images, refs, footnotes, and code blocks.

If you only need one part of the markdown metadata pipeline, use the smaller
`parseMarkdownWithX` helpers.

| I need... | Import | Parses YAML frontmatter? |
| --- | --- | --- |
| everything | `@davidwells/md-utils/parse` | yes |
| content + parsed frontmatter | `@davidwells/md-utils/parse/frontmatter` | yes |
| content + TOC | `@davidwells/md-utils/parse/toc` | no |
| content + code blocks | `@davidwells/md-utils/parse/code-blocks` | no |
| content + links/images/refs | `@davidwells/md-utils/parse/links` | no |

```js
import { parseMarkdown } from '@davidwells/md-utils/parse'
import { parseMarkdownWithFrontmatter } from '@davidwells/md-utils/parse/frontmatter'
import { parseMarkdownWithToc } from '@davidwells/md-utils/parse/toc'
import { parseMarkdownWithCodeBlocks } from '@davidwells/md-utils/parse/code-blocks'
import { parseMarkdownWithLinks } from '@davidwells/md-utils/parse/links'
```

Frontmatter parsing is explicit. If you import
`parseMarkdownWithFrontmatter`, you pay the `gray-matter` / YAML cost. The
other `withX` helpers operate on markdown content and do not parse
frontmatter.

```js
const doc = parseMarkdownWithFrontmatter(markdown)
const outline = parseMarkdownWithToc(doc.content)
```

## Other packages

- https://www.npmjs.com/package/markdown-magic

---
_Source: https://npm.io/package/@davidwells/md-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
