@clearfeed-ai/slack-to-html

中文文档
1.2.8发布于 2026/10/21MITCommonJS近 30 天下载 3088

Render Slack markdown as HTML

原始使用文档
文档目录11 节
  1. Installation
  2. Usage
  3. Render universal Slack markdown as HTML
  4. Replace Slack user IDs with user names
  5. Replace Slack channel IDs with channel names
  6. Replace Custom Slack emojis
  7. Replace subteam names (for paid accounts)
  8. Testing
  9. Upcoming
  10. Contribution
  11. License

Slack to HTML

Forked originally from https://github.com/swiftype/slack-hawk-down & https://github.com/hectorbenitez/slack-to-html

Slack markdown to HTML

Installation

npm install --save slack-to-html

Usage

Render universal Slack markdown as HTML

import { escapeForSlack, escapeForSlackWithMarkdown } from 'slack-hawk-down'

escapeForSlack(':wave:') // => 'Ґ'
escapeForSlackWithMarkdown('`this is a code block`) // => '<span class="slack_code">this is a code block</span>'

You can view the rest of the markdown styles here

Replace Slack user IDs with user names

escapeForSlack('<@U123|david> did you see my pull request?', { users: { 'U123': 'david', ... } }) // => '@david did you see my pull request?'

You can get a list of the users in your Slack team by requesting this endpoint with a users:read scope

Replace Slack channel IDs with channel names

escapeForSlack('<#C123> please fill out this poll', { channels : { '#C123': 'general', ... } }) // => '#general please fill out this poll'

You can get a list of the users in your Slack team by requesting this endpoint with a channels:read scope

Replace Custom Slack emojis

escapeForSlack(':facepalm:', { customEmoji: { facepalm: 'http://emojis.slackmojis.com/emojis/images/1450319441/51/facepalm.png', ... } }) // => '<img alt="facepalm" src="http://emojis.slackmojis.com/emojis/images/1450319441/51/facepalm.png" />'

You can get a list of custom emoji for your Slack team by requesting this endpoint with a emoji:read scope

Replace subteam names (for paid accounts)

escapeForSlack('<!subteam^S123>', { usergroups: { 'S123': 'swiftype-eng', ...} }) // => 'swiftype-eng'

You can get a list of user groups for your Slack team by requesting this endpoint with a usergroups:read scope

Testing

npm test

Upcoming

  • Customizeable element and class names for markdown elements

Contribution

Please open a pull request or issue

License

MIT

版本与发布记录

@clearfeed-ai/slack-to-html 共发布 27 个版本,首次发布于 2022/01/12;过去 12 个月发布了 10 个版本。

版本发布日期距今
1.2.8latest2026/10/2119 天前
1.2.72026/06/164 个月前
1.2.62026/06/164 个月前
1.2.52026/02/198 个月前
1.2.42026/02/198 个月前
1.2.32026/02/198 个月前

关于 @clearfeed-ai/slack-to-html 的常见问题

@clearfeed-ai/slack-to-html 是什么?

Render Slack markdown as HTML

如何安装 @clearfeed-ai/slack-to-html?

在项目目录运行 npm install @clearfeed-ai/slack-to-html,或使用 pnpm add / yarn add / bun add。

@clearfeed-ai/slack-to-html 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/clearfeed-ai__slack-to-html 是否存在。

@clearfeed-ai/slack-to-html 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@clearfeed-ai/slack-to-html 可以商用吗?

@clearfeed-ai/slack-to-html 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@clearfeed-ai/slack-to-html 的下载量有多少?

根据 npm 官方下载统计,@clearfeed-ai/slack-to-html 在 2026/10/10 – 2026/11/08 这 30 天内被下载 3,088 次,日均约 103 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@clearfeed-ai/slack-to-html 还在维护吗?

最新版本 1.2.8 发布于 2026/10/21(19 天前);至今共发布 27 个版本,其中过去 12 个月发布了 10 个;首次发布于 2022/01/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。