@tpmjs/markdown-formatter
Convert markdown to plain text by removing all formatting
Test @tpmjs/markdown-formatter (markdownToPlainText) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/markdown-formatterpnpm add @tpmjs/markdown-formatteryarn add @tpmjs/markdown-formatterbun add @tpmjs/markdown-formatterdeno add npm:@tpmjs/markdown-formatterimport { markdownToPlainText } from '@tpmjs/markdown-formatter';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { markdownToPlainText } from '@tpmjs/markdown-formatter';
const result = await generateText({
model: openai('gpt-4o'),
tools: { markdownToPlainText },
prompt: 'Your prompt here...',
});
console.log(result.text);(markdown: string, preserveLineBreaks: boolean) => Promise<unknown>Available configuration options
markdownstringThe markdown text to convert to plain text
preserveLineBreaksbooleanWhether to preserve line breaks in the output
Schema extracted: 2/28/2026, 4:01:12 AM
AI SDK tools for formatting and manipulating markdown text. Perfect for cleaning up markdown documents and making tables more readable!
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."
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
npm install @tpmjs/markdown-formatter
MIT
Downloads/month
16
GitHub Stars
0
Quality Score