{"id":21259230,"url":"https://github.com/vlad-iakovlev/telegram-md","last_synced_at":"2025-07-11T02:33:11.213Z","repository":{"id":46884155,"uuid":"515715400","full_name":"vlad-iakovlev/telegram-md","owner":"vlad-iakovlev","description":"Telegram MarkdownV2 formatter","archived":false,"fork":false,"pushed_at":"2025-06-29T20:04:29.000Z","size":1554,"stargazers_count":29,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-29T20:06:28.543Z","etag":null,"topics":["markdown","markdown-parser","npm-package","telegram"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vlad-iakovlev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-19T19:24:53.000Z","updated_at":"2025-06-29T20:03:25.000Z","dependencies_parsed_at":"2023-02-12T04:15:51.746Z","dependency_job_id":"819b9eda-8f19-4d92-905e-02cbcddb7f83","html_url":"https://github.com/vlad-iakovlev/telegram-md","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"7ee15aa521590f9031be73f17aa4c14c04bd506a"},"previous_names":["vlad-iakovlev/telegram-md","vlad-yakovlev/telegram-md"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/vlad-iakovlev/telegram-md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-iakovlev%2Ftelegram-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-iakovlev%2Ftelegram-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-iakovlev%2Ftelegram-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-iakovlev%2Ftelegram-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vlad-iakovlev","download_url":"https://codeload.github.com/vlad-iakovlev/telegram-md/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-iakovlev%2Ftelegram-md/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264712954,"owners_count":23652696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","markdown-parser","npm-package","telegram"],"created_at":"2024-11-21T04:13:10.220Z","updated_at":"2025-07-11T02:33:11.208Z","avatar_url":"https://github.com/vlad-iakovlev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# telegram-md\n\nTelegram MarkdownV2 formatter\n\n![GitHub CI](https://img.shields.io/github/actions/workflow/status/vlad-iakovlev/telegram-md/ci.yml?branch=main\u0026label=github-ci)\n[![Codecov](https://img.shields.io/codecov/c/github/vlad-iakovlev/telegram-md/main)](https://codecov.io/gh/vlad-iakovlev/telegram-md)\n[![NPM](https://img.shields.io/npm/v/@vlad-yakovlev/telegram-md)](https://www.npmjs.org/package/@vlad-yakovlev/telegram-md)\n\n`telegram-md` is a powerful TypesScript library designed to simplify the formatting of text messages in Telegram MarkdownV2 format. It provides a range of methods for applying markdown formatting, such as bold, italic, and links, making it easier to create richly formatted messages programmatically.\n\n## Table of Contents\n\n1. [How to Install](#how-to-install)\n2. [Usage Examples](#usage-examples)\n3. [API Documentation](#api-documentation)\n\n## How to install\n\n```sh\nnpm install @vlad-yakovlev/telegram-md\n```\n\n## Usage Examples\n\n```ts\nimport { md } from '@vlad-yakovlev/telegram-md'\n\n// Simple message formatting\nconst message = md`Hello, ${md.bold('World')}!`\napi.sendMessage(chatId, md.build(message))\n\n// Using different formatting styles\nconst complexMessage = md`\n  This is an ${md.italic('italic')}\n  and ${md.bold('bold')} text\n  with a ${md.link('link', 'http://example.com')}!\n`\napi.sendMessage(chatId, md.build(complexMessage))\n```\n\n## API Documentation\n\nEvery method escapes all unescaped input. Input is assumed to be escaped only when it's an instance of Markdown.\n\n### Markdown\n\nStores the result of executing md methods. Used to differentiate between normal strings and escaped strings.\n\n### md\n\nTemplate tag which can be used to build markdown formatted messages.\n\n```ts\nmd`Hello, ${md.bold('World')}!` // =\u003e Markdown with value 'Hello, *World*\\\\!'\n```\n\n### md.build\n\nReturns message text that cat be safely sent to telegram API.\n\n```ts\nmd.build(md`Hello, ${md.bold('World')}!`) // =\u003e 'Hello, *World*\\\\!'\nmd.build('Hello, World!') // =\u003e 'Hello, World\\\\!'\n```\n\n### md.bold\n\n```ts\nmd.bold('bold *text') // =\u003e Markdown with value '*bold \\*text*'\n```\n\n### md.italic\n\n```ts\nmd.italic('italic *text') // =\u003e Markdown with value '_italic \\*text_'\n```\n\n### md.underline\n\n```ts\nmd.underline('underline') // =\u003e Markdown with value '__underline__'\n```\n\n### md.strikethrough\n\n```ts\nmd.strikethrough('strikethrough') // =\u003e Markdown with value '~strikethrough~'\n```\n\n### md.spoiler\n\n```ts\nmd.spoiler('spoiler') // =\u003e Markdown with value '||spoiler||'\n```\n\n### md.link\n\n```ts\nmd.link('inline URL', 'http://www.example.com/') // =\u003e Markdown with value '[inline URL](http://www\\\\.example\\\\.com/)'\nmd.link('inline mention of a user', 'tg://user?id=123456789') // =\u003e Markdown with value '[inline mention of a user](tg://user?id\\\\=123456789)'\n```\n\n### md.inlineCode\n\n```ts\nmd.inlineCode('inline fixed-width code') // =\u003e Markdown with value '`inline fixed\\\\-width code`'\n```\n\n### md.blockquote\n\n```ts\nmd.blockquote('blockquote') // =\u003e Markdown with value '\u003eblockquote'\n```\n\n### md.codeBlock\n\n````ts\nmd.code(\n  'pre-formatted fixed-width code block',\n) // =\u003e Markdown with value\n```\npre\\\\-formatted fixed\\\\-width code block\n```\n````\n\n````ts\nmd.code(\n  'pre-formatted fixed-width code block written in the Python',\n  'python',\n) // =\u003e Markdown with value\n```python\npre\\\\-formatted fixed\\\\-width code block written in the Python\n```\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlad-iakovlev%2Ftelegram-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlad-iakovlev%2Ftelegram-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlad-iakovlev%2Ftelegram-md/lists"}