You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

tgast

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tgast

Telegram Abstract Syntax Tree format.

2.0.0
next
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

tgast banner

tgast

Telegram Abstract Syntax Tree for Telegram message entities.

tgast provides a way to represent Telegram message entities as a structured format called an Abstract Syntax Tree (AST). It's built using the unist specification, making it easy to work with and extend.

For released versions, see releases.

Contents

Introduction

tgast is a specification for representing Telegram message entities as an Abstract Syntax Tree (AST). It was initially created for the regram project.

Where this specification fits

tgast leverages the unist format for syntax trees, allowing you to benefit from its extensive ecosystem of utilities.

tgast is used within the regram and unified projects for processing Telegram message content.

Installation

You can use tgast by installing it from npm:

# deno
deno add -D npm:tgast

# bun
bun add -D tgast

# pnpm
pnpm add -D tgast

# yarn
yarn add -D tgast

# npm
npm install -D tgast

Nodes

  • Blockquote: Telegram block quotation. Represents blockquote entities in Telegram messages.
  • Bold: Telegram bold text. Represents bold entities in Telegram messages.
  • BotCommand: Telegram bot command. Represents bot_command entities in Telegram messages.
  • Cashtag: Telegram cashtag. Represents cashtag entities in Telegram messages.
  • Code: Telegram monowidth string. Represents code entities in Telegram messages.
  • CustomEmoji: Telegram custom emoji. Represents custom_emoji entities in Telegram messages.
  • Email: Telegram email address. Represents email entities in Telegram messages.
  • ExpandableBlockquote: Telegram expandable blockquote. Represents expandable_blockquote entities in Telegram messages.
  • Hashtag: Telegram hashtag. Represents hashtag entities in Telegram messages.
  • Italic: Telegram italic text. Represents italic entities in Telegram messages.
  • Mention: Telegram mention. Represents mention entities in Telegram messages.
  • PhoneNumber: Telegram phone number. Represents phone_number entities in Telegram messages.
  • Pre: Telegram monowidth block. Represents pre entities in Telegram messages.
  • Spoiler: Telegram spoiler message. Represents spoiler entities in Telegram messages.
  • Strikethrough: Telegram strikethrough text. Represents strikethrough entities in Telegram messages.
  • Text: Telegram plain text. Represents plain text content in Telegram messages.
  • TextLink: Telegram clickable text URL. Represents text_link entities in Telegram messages.
  • TextMention: Telegram mentions for users without usernames. Represents text_mention entities in Telegram messages.
  • Underline: Telegram underline text. Represents underline entities in Telegram messages.
  • Url: Telegram URL. Represents url entities in Telegram messages.

Glossary

See § Glossary in syntax-tree/unist.

References

  • mdast — Markdown Abstract Syntax Tree format
  • hast — HTML Abstract Syntax Tree format
  • nlcst — Natural Language Concrete Syntax Tree format
  • xast — Extensible Abstract Syntax Tree

Keywords

telegram

FAQs

Package last updated on 15 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts