tpmjs/packages/tools/markdown-formatter
Ajax Davis 5c9f1a1d0a chore: update dependencies with compatibility fixes
- Update all packages to latest versions via pnpm update --latest
- Downgrade Prisma 7 to 6 (v7 requires schema migration)
- Downgrade Tailwind CSS 4 to 3 (v4 requires PostCSS migration)
- Downgrade Storybook 10 to 8 (addons not available in v10)
- Pin cheerio to 1.0.0-rc.12 via pnpm override (type exports changed)
- Fix AI SDK tool definitions: parameters -> inputSchema
- Fix cheerio types in extract-meta and table-extract tools
- Add explicit type annotations to tool execute functions
- Migrate biome config to v2.3.11 schema

All type-checks, tests, and builds pass.
2026-01-09 22:49:41 +10:00
..
src feat: add markdown-formatter package with defensive patterns 2025-12-05 01:31:03 +10:00
CHANGELOG.md feat: add markdown-formatter package with defensive patterns 2025-12-05 01:31:03 +10:00
package.json chore: update dependencies with compatibility fixes 2026-01-09 22:49:41 +10:00
README.md feat: add markdown-formatter package with defensive patterns 2025-12-05 01:31:03 +10:00
tsconfig.json feat: add markdown-formatter package with defensive patterns 2025-12-05 01:31:03 +10:00

@tpmjs/markdown-formatter

AI SDK tools for formatting and manipulating markdown text. Perfect for cleaning up markdown documents and making tables more readable!

Tools

markdownToPlainText

Convert markdown to plain text by removing all formatting.

import { markdownToPlainText } from '@tpmjs/markdown-formatter';

const result = await markdownToPlainText.execute({
  markdown: '# Hello **World**\n\nThis is *italic* text.',
  preserveLineBreaks: true,
});
// Result: "Hello World\n\nThis is italic text."

formatMarkdownTable

Format and align markdown table columns for better readability.

import { formatMarkdownTable } from '@tpmjs/markdown-formatter';

const result = await formatMarkdownTable.execute({
  table: `
| Name | Age | City |
|---|---|---|
| Alice | 30 | NYC |
| Bob | 25 | LA |
  `,
  alignment: 'left',
});
// Returns a beautifully formatted table with aligned columns

Installation

npm install @tpmjs/markdown-formatter

Features

  • Strip markdown formatting to plain text
  • Preserve or remove line breaks
  • Format markdown tables with column alignment
  • Support for left, center, and right alignment
  • Defensive parameter validation

License

MIT