🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@aiello/wechat-to-markdown

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aiello/wechat-to-markdown

解析微信文章 URL 为 markdown

latest
npmnpm
Version
1.2.16
Version published
Maintainers
1
Created
Source

wechat-to-markdown

Fork from https://github.com/LuckyRyan-web/wechat-to-markdown

add some bug fix

yarn add @aiello/wechat-to-markdown
# or
npm install @aiello/wechat-to-markdown

description

Enter the WeChat public address to convert it to markdown format

English | 简体中文

return options

interface TurnDownResult {
    success: boolean
    code: number
    data?: {
        title?: string
        author?: string
        content?: string
    }
    msg?: string
}

Basic Usage

CommonJs

const transformHtml2Markdown = require('@aiello/wechat-to-markdown').default

setTimeout(async () => {
    const articleData = await transformHtml2Markdown('https://mp.weixin.qq.com/s/9d5DWg7YdMHPvVl-2KLH2w')

    const { title, author, content } = articleData.data

    console.log('title', title)
    console.log('author', author)
    console.log('content', content)
}, 0)

vue3

index.ts

import transformHtml2Markdown from '@aiello/wechat-to-markdown'

setup() {
    const getData = async () => {
        const articleData = await transformHtml2Markdown(
            '/api/s/9d5DWg7YdMHPvVl-2KLH2w'
        )

        const { title, author, content } = articleData.data

        console.log('title', title)
        console.log('author', author)
        console.log('content', content)
    }

    getData()

    return {}
},

vite.config.ts

...
server: {
    proxy: {
        '/api': {
            target: 'https://mp.weixin.qq.com',
            changeOrigin: true,
            rewrite: (path) => path.replace(/^\/api/, ''),
        },
    },
},
...

Packages

axios

cheerio

turndown (html to markdown)

turndown-plugin-gfm (turndown parsing partial html element plugin)

Reference

html2md (A very well developed url to markdown project)

TODO

  • The markdown code that supports conversion can replace the image and upload it to the cdn

Keywords

wechat to markdown

FAQs

Package last updated on 30 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts