惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
WordPress大学
WordPress大学
罗磊的独立博客
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
Docker
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
J
Java Code Geeks
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
美团技术团队
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog

博客园 - 荣锋亮

just-git 纯js 的git 实现 阿里开源的UnifiedModel agno agentos interfaces 简单说明 agno agentos ag-ui 协议 agno agentos 暴露a2a 协议 agno gateway模式 agno 多agent 框架集成能力 agno agentos 简单说明 agno workflow 模式简单说明 agno team agent 简单说明 agno remote agent 简单说明 agno agent 使用 agno agent 平台 sshpiper 简单试用 sshpiper ssh 的反向代理服务 context-propagation spring reactor 的上下文传递包 nginx 发布1.31.2 了 reductstore 的一些部署模式 reductstore 数据写入模式 reductstore bridge 方便reductstore数据bridge 扩展 reductstore zenoh 集成 zenoh 1.9.x 一些新特性 ladybugdb嵌入式图数据库 BlockHound 检测 reactor阻塞调用的agent reductstore 高性能面向机器人以及IOT场景的存储以及流数据基石 zerofs 一些新功能 java nats request-many 支持的一些模式 java nats RequestMany context7 面向llm 以及ai代码编辑器的依赖包更新平台 NATS Agents Protocol nats 团队提出的agent 通信协议
turndown html 转markdown npm包
荣锋亮 · 2026-05-14 · via 博客园 - 荣锋亮

此工具包在agent 周年使用还是挺多的,同时支持不少配置参数

参考玩法

import { VfsSandbox } from "@langchain/node-vfs";
import turndown from "turndown"
import fecth from "node-fetch"
const sandbox = await VfsSandbox.create({
  initialFiles: {
    "/src/index.js": "console.log('Hello from VFS!')",
  },
});

const markdown = new turndown().turndown(`
    <h1>Turndown Demo</h1>

<p>This demonstrates <a href="https://github.com/mixmark-io/turndown">turndown</a> – an HTML to Markdown converter in JavaScript.</p>

<h2>Usage</h2>

<pre><code class="language-js">var turndownService = new TurndownService()
console.log(
  turndownService.turndown('&lt;h1&gt;Hello world&lt;/h1&gt;')
)</code></pre>

<hr />

<p>It aims to be <a href="http://commonmark.org/">CommonMark</a>
 compliant, and includes options to style the output. These options include:</p>

<ul>
  <li>headingStyle (setext or atx)</li>
  <li>horizontalRule (*, -, or _)</li>
  <li>bullet (*, -, or +)</li>
  <li>codeBlockStyle (indented or fenced)</li>
  <li>fence ( or ~)</li>
  <li>emDelimiter (_ or *)</li>
  <li>strongDelimiter (** or __)</li>
  <li>linkStyle (inlined or referenced)</li>
  <li>linkReferenceStyle (full, collapsed, or shortcut)</li>
</ul>
 `);

const result = await sandbox.execute(`echo "${markdown}" > /src/hello.md && cat /src/hello.md`);

let fileLists = await sandbox.ls("/src");
const fileContent = await sandbox.readRaw("/src/hello.md");
console.log(fileContent.data.content);

说明

turndown 同时还支持配置参数,不少agent 框架 在用

参考资料

https://www.npmjs.com/package/turndown

https://github.com/mixmark-io/turndown

https://mixmark-io.github.io/turndown/