slack-message-parser

JavaScript library for parsing Slack message format (mrkdwn)

Guide

slack-message-parser is a JavaScript library which parses the message returned by Slack API and give you a tree object (imagine AST). You could use the result tree to create a message viewer (HTML, React component, etc…) or whatever you want :)

Installation

The package is available as slack-message-parser on npm.

yarn add slack-message-parser
# npm i --save slack-message-parser

Quick Start

Just parse the message!

import slackMessageParser from "slack-message-parser";

const tree = slackMessageParser("Slack *message* ~to~ _parse_");

console.dir(tree);

Supported Message Features

Examples

Plain HTML with TypeScript

React with TypeScript