channel-formatter
v1.0.0
Published
Format AI response Markdown for Telegram, Slack, Teams, and SMS — zero dependencies
Downloads
0
Maintainers
Readme
channel-formatter
Format markdown-like AI output for messaging channels with different syntax and size limits.
Features
- Telegram MarkdownV2 escaping
- Slack-friendly markdown conversion
- Plain-text SMS fallback
- Message chunking by channel size limits
Install
npm install channel-formatterUsage
import { formatForChannel } from "channel-formatter";
const chunks = formatForChannel(markdown, "telegram");
for (const chunk of chunks) {
await sendMessage(chunk);
}Supported Channels
telegramslackteamssms
Exports
formatForChannel(text, channel)splitMessage(text, maxLen)
Best for notification bots, chat assistants, and workflow tools that need channel-specific output formatting.
