npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

markdown-to-slack

v1.5.2

Published

Convert Markdown to Slack Block Kit JSON

Downloads

1,195

Readme

markdown-to-slack

Convert Markdown to Slack Block Kit JSON format.

Usage

CLI

Install and use as command-line tool.

npm install -g markdown-to-slack

# Using echo pipe
echo "# Hello World" | md2s

# Full command name also available
echo "# Hello World" | markdown-to-slack

Library

Use as TypeScript/JavaScript library.

import { MarkdownToSlack } from './source/module'

const markdown = `
# Title
**Bold** and *italic* text
- Item 1
- Item 2
`

const messages = MarkdownToSlack.convert(markdown)
console.log(JSON.stringify(messages, null, 2))

API

  • MarkdownToSlack.convert(markdown: string): SlackMessage[]
    • Returns array of Slack messages (split by 50-block limit or tables)

Mapping Table

| Markdown | Slack Block Kit | Notes | |----------|----------------|-------| | # Heading 1 | Header Block (auto-split if >150 chars) | H1 with visual separation | | ## Heading 2 | Header Block (auto-split if >150 chars) | H2 with divider | | ### Heading 3 | Header Block (auto-split if >150 chars) | H3 as header | | #### Heading 4-6 | Section (bold) | H4-H6 as bold text | | **bold** / __bold__ | Rich Text (bold) | Bold formatting | | *italic* / _italic_ | Rich Text (italic) | Italic formatting | | ***bold+italic*** | Rich Text (bold+italic) | Combined formatting | | *_text_* | Rich Text (bold+italic) | Alternative combined format | | ~~strikethrough~~ | Rich Text (strike) | Double tilde strikethrough | | ~strikethrough~ | Rich Text (strike) | Single tilde strikethrough | | `code` | Rich Text (code) | Inline code | | [text](url) | Rich Text Link | Hyperlink | | - item / * item / + item | Rich Text List (bullet) | Unordered list | | 1. item | Rich Text List (ordered) | Ordered list | | - nested | Rich Text List (indent) | Nested lists (multi-level) | | 5. item | Rich Text List (offset) | Custom start number | | - [ ] task / - [x] task | Rich Text List | Task checkboxes (stripped) | | ```code``` | Rich Text Preformatted | Code block (no language specified) | | ```lang``` | Context Block + Rich Text Preformatted | Code block with language context | | > quote | Rich Text Quote | Blockquote | | --- / *** / ___ | Divider Block | Horizontal rule | | Markdown table | Context Block + Table Block | Context shows row count, tables (max 1 per message) | | Table cells with markdown | Rich Text Cell | Inline formatting in cells | | <br> / <br/> | \n | Line break (converted before parsing) | | :emoji: | Emoji | Emoji shortcode | | ![alt](url) / <img> | Image Block | Alt text as title, Slack file URL supported | | <details><summary> | Divider section | Collapsible section with dividers |

Messages are automatically split due to Slack limitations.

  • Maximum 50 blocks per message
  • Maximum 1 table per message
  • Tables are isolated into separate messages
  • Header text exceeding 150 characters is automatically split into multiple headers