Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@m2d/emoji

md2docx20.4kMPL-2.00.1.3TypeScript support: included

A plugin for @m2d/core that parses emoji shortcodes like :smile: and replaces them with their corresponding Unicode emoji characters for DOCX output.

emoji, emoji-plugin, emoji-support, shortcode, unicode, text-processing, markdown-to-docx, mdast-to-docx, mdast, markdown, md2docx, mdast2docx, plugin, converter, docx, ms-word, document-generator, document-generation, remark, unified, images, hyperlinks, footnotes, typescript, open-source, customizable, modern, seamless-integration, cutting-edge, compatibility, progressive, web-development, frontend, automation, google-sheets, generative-ai, rich-text, m2d, mayank1513

readme

@m2d/emoji

test Maintainability codecov Version Downloads npm bundle size

Emoji shortcode support for mdast2docx

This plugin adds support for emoji shortcodes (e.g., :smile:, :rocket:) in your Markdown-to-DOCX conversion pipeline. It replaces recognized emoji shortcodes with their corresponding Unicode characters during the MDAST transformation.


✨ Features

  • Converts emoji shortcodes to Unicode emojis (e.g., :tada: → 🎉)
  • Compatible with @m2d/core
  • Works seamlessly within the mdast2docx plugin ecosystem
  • Easy to integrate and lightweight

📦 Installation

pnpm install @m2d/emoji

or

yarn add @m2d/emoji

or

npm add @m2d/emoji

🧠 How It Works

This plugin scans all text nodes for emoji shortcodes (e.g., :fire:, :sparkles:) and replaces them with matching Unicode emojis using a predefined emoji JSON mapping.


🔍 Emoji Support

It uses the GitHub-style emoji shortcodes and more — if a shortcode is not recognized, it will remain unchanged.


🛠️ Development

# Clone and install dependencies
git clone https://github.com/md2docx/emoji-plugin
cd emoji-plugin
npm install

# Build / Test / Dev
npm run build

📄 License

Licensed under the MPL-2.0 License.


⭐ Support Us

If you find this useful:


Made with 💖 by Mayank Kumar Chaudhari