tpmjs/packages/tools/markdown-formatter
Ajax Davis 48c41e8733 feat: add use cases marketing product with AI-generated content
Transform qualifying scenarios into marketing-ready use cases with:
- AI-generated titles, descriptions, ROI estimates, business value
- Persona/industry/category taxonomy for targeting
- Browseable feed with filtering and ranking
- SEO-optimized case study pages
- Daily cron job for generation and ranking

Database:
- Add Persona, Industry, Category lookup tables
- Add UseCase model with marketing content fields
- Add junction tables for personas/industries/categories
- Add SocialProof model for cached metrics

API:
- GET /api/use-cases - Global directory with filtering
- GET /api/use-cases/[id] - Individual use case details
- GET /api/public/users/[username]/collections/[slug]/use-cases
- POST /api/cron/use-cases - Nightly generation job

Frontend:
- /use-cases - Global feed with persona dropdown
- /use-cases/[slug] - SEO case study page
- /[username]/collections/[slug]/use-cases - Collection feed
- UseCasesFeed component - Sortable table component
- UseCaseCaseStudy component - Full case study layout
2026-01-20 16:17:35 +10:00
..
src feat: add use cases marketing product with AI-generated content 2026-01-20 16:17:35 +10:00
CHANGELOG.md feat: add markdown-formatter package with defensive patterns 2025-12-05 01:31:03 +10:00
package.json refactor: replace exportName with name throughout codebase 2026-01-14 14:18:36 +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