# @m2d/list

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

Latest version **0.0.10** (published 2026-10-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2026-10-20 |
| First published | 2025-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mayank Kumar Chaudhari <https://mayankchaudhari.com> |
| 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/@m2d/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/@m2d/list

## 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.10 (latest) — 2026-10-20
- 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
- 0.0.2 — 2025-03-24
- 0.0.1 — 2025-03-24
- 0.0.0 — 2025-03-23

## 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

```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/@m2d/list · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
