# @mdast2docx/list

> Plugin to convert ordered and unordered lists from Markdown (MDAST) to DOCX. Supports nesting, custom bullets, and numbering styles.

Latest version **0.0.11** (published 2026-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mdast2docx/list
pnpm add @mdast2docx/list
yarn add @mdast2docx/list
bun add @mdast2docx/list
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2026-10-22 |
| First published | 2025-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Mayank Kumar Chaudhari |
| Maintainers | mayank1513 |
| Keywords | mdast, markdown, docx, markdown-to-docx, mdast-to-docx, ordered-list, unordered-list, nested-lists, bullet-points, numbered-lists, document-generation, text-processing, open-source, typescript, converter, automation, unified, remark, web-development, export, rich-text |

## Links

- npm: https://www.npmjs.com/package/@mdast2docx/list
- Repository: https://github.com/md2docx/md2docx
- Homepage: https://github.com/md2docx/md2docx/blob/main/packages/list/README.md
- Issues: https://github.com/md2docx/md2docx/issues
- Funding: https://github.com/sponsors/md2docx
- npm.io page: https://npm.io/package/@mdast2docx/list

## Dependencies (1)

- [@m2d/list](https://npm.io/package/@m2d/list.md) 0.0.11

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.0.11 (latest) — 2026-10-22
- 0.0.9 — 2025-09-30
- 0.0.8 — 2025-06-06
- 0.0.7 — 2025-05-29
- 0.0.6 — 2025-05-20
- 0.0.5 — 2025-04-12
- 0.0.4 — 2025-04-08
- 0.0.3 — 2025-03-25

## README

# @m2d/list <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 40px"/>

<p className="flex gap-2">
  <a href="https://github.com/md2docx/md2docx/actions/workflows/ci.yml" rel="noopener noreferrer">
    <img alt="CI" src="https://github.com/md2docx/md2docx/actions/workflows/ci.yml/badge.svg" />
  </a>
  <a href="https://codecov.io/gh/md2docx/md2docx/tree/main/packages/@m2d/list" rel="noopener noreferrer">
    <img alt="codecov" src="https://codecov.io/gh/md2docx/md2docx/graph/badge.svg?flag=@m2d/list" />
  </a> 
  <a href="https://npmjs.com/package/@m2d/list" rel="noopener noreferrer">
    <img alt="npm version" src="https://img.shields.io/npm/v/@m2d/list" />
  </a>
  <a href="https://npmjs.com/package/@m2d/list" rel="noopener noreferrer">
    <img alt="npm downloads" src="https://img.shields.io/npm/d18m/@m2d/list" />
  </a>
  <a href="https://npmjs.com/package/@m2d/list" rel="noopener noreferrer">
    <img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/@m2d/list" />
  </a>
  <img alt="license" src="https://img.shields.io/npm/l/@m2d/list" />
</p>

> @m2d/list: Markdown List & Numbering conversion plugin for `@m2d/core`. Transforms ordered and bullet lists into native Word OpenXML numbering schemes.

---

## ✨ Features

- 🔢 **Hierarchical Decimal Numbering**: Generates clear, multi-level outline numbering (`1.`, `1.1.`, `1.1.1.`, `A.`, `a.`, `i.`) that avoids resetting arbitrarily at sub-levels.
- 🔲 **Multi-Tier Bullet Glyphs**: Automatically assigns distinct bullet characters (`●`, `○`, `■`, `◆`, `▶`, etc.) across nested list levels.
- 📄 **Native Word OpenXML Numbering**: Registers genuine Word abstract numbering schemes in `numbering.xml`, ensuring list items update dynamically in Word.
- ⚙️ **Fully Customizable Levels**: Use the exported `createLevels` utility to define custom indentation steps, start depths, and format sequences.
- 🏢 **Word Preset Support**: Toggle `defaultBullets: true` to seamlessly match standard Word template bullet configurations.

---

## 📦 Installation


> [!TIP]
> **This package (@mdast2docx/list) is an official alias of [@m2d/list](https://npmjs.com/package/@m2d/list).**

<details>
<summary>Why does this exist?</summary>

We provide this package to offer shorter import paths and improved discoverability. While both packages provide identical functionality, **@m2d/list** is the primary source of truth.
</details>

<details>
<summary>Which one should I use?</summary>

* **Use @mdast2docx/list** if you prefer the shorter name or specific branding or ESM Only.
* **Use @m2d/list** for the most stable long-term reference and standard alignment.

| Feature | @m2d/list | @mdast2docx/list |
| --- | --- | --- |
| **Source Code** | ✅ Primary | 🔗 Proxy |
| **Updates** | Immediate | Synchronized (Immediately) |
| **Bundle Size** | 100% | 100% (Zero overhead) |
| **Format** | ESM + CJS | ESM Only |
| **Maintenance** | ✅ Primary | 🔗 Proxy (inherits) |
| **Security** | ✅ Primary | 🔗 Proxy (inherits) |

</details>

<details>
<summary>Maintenance & Support</summary>

> **Security:** Security audits are performed on the canonical package; this alias inherits all security patches automatically.
</details>

---



```bash
$ pnpm add @m2d/list @m2d/core docx
```

**_or_**

```bash
$ npm install @m2d/list @m2d/core docx
```

**_or_**

```bash
$ yarn add @m2d/list @m2d/core docx
```

---

## 🚀 Quick Start

```typescript
import { toDocx } from "@m2d/core";
import { listPlugin } from "@m2d/list";
import remarkParse from "remark-parse";
import { unified } from "unified";

const markdown = `
# Project Plan

1. Inception Phase
   1. Requirements Gathering
   2. Stakeholder Review
2. Implementation Phase
   1. Core Engine Development
      - Microservices architecture
      - Message queues
   2. Quality Assurance
`;

const mdast = unified().use(remarkParse).parse(markdown);

const docxBlob = await toDocx(mdast, {}, {
  plugins: [listPlugin()],
});
```

---

## ⚙️ Plugin Options

```typescript
import { ILevelsOptions } from "docx";

export interface IListPluginOptions {
  /** Defines custom numbering styles for ordered lists */
  levels?: ILevelsOptions[];

  /** Defines custom numbering styles for bullet lists */
  bulletLevels?: ILevelsOptions[];

  /** Bullet characters used for unordered lists (default: ["●", "○", "■", "◆", ...]) */
  bullets?: string[];

  /** If true, uses Word's default bullet styles instead of custom ones (default: false) */
  defaultBullets?: boolean;
}
```

---

## 📚 Deep Dive Guides

- 🔢 **[Ordered Lists & Hierarchical Numbering Guide](./docs/ordered-lists-and-numbering.mdx)**: Multi-level decimal numbering schemas, outline sequences, and the `createLevels` helper.
- 🔲 **[Bullet Styles & Nesting Guide](./docs/bullet-styles-and-nesting.mdx)**: Bullet glyph hierarchies, custom characters, and Word native preset modes.

---

## License

This library is licensed under the MIT open-source license.

<hr />

<p align="center">with 💖 by <a href="https://mayankchaudhari.com" target="_blank">Mayank Kumar Chaudhari</a></p>

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