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 🙏

© 2025 – Pkg Stats / Ryan Hefner

yuque-dl

v1.0.73

Published

yuque 知识库下载

Downloads

305

Readme

yuque-dl

语雀知识库下载为本地markdown

header

Prerequisite

  • Node.js 18.4 or later

Install

npm i -g yuque-dl

Usage

$ yuque-dl --help

  Usage:
    $ yuque-dl <url>

  Commands:
    <url>                语雀知识库url
    server <serverPath>  启动web服务

  For more info, run any command with the `--help` flag:
    $ yuque-dl --help
    $ yuque-dl server --help

  Options:
    -d, --dist-dir <dir>  下载的目录 eg: -d download (default: download)
    -i, --ignore-img      忽略图片不下载 (default: false)
    -k, --key <key>       语雀的cookie key, 默认是 "_yuque_session", 在某些企业版本中 key 不一样 
    -t, --token <token>   语雀的cookie key 对应的值 
    --toc                 是否输出文档toc目录 (default: false)
    -h, --help            Display this message 
    -v, --version         Display version number 

Start

# url 为对应需要的知识库地址
yuque-dl "https://www.yuque.com/yuque/thyzgp"

Example

demo

其他场景

私有知识库

通过别人私有知识库 分享的链接,需使用-t添加token才能下载

yuque-dl "https://www.yuque.com/yuque/thyzgp" -t "abcd..."

token的获取请看

企业私有服务

企业服务有自己的域名(黄色语雀logo),非yuque.com结尾, 如https://yuque.antfin.com/r/zone

这种情况 token的key不唯一, 不一定是为_yuque_session 需用户使用 -k 指定 token的key,-t 指定 token的值。

至于key具体是什么只能靠用户自己在 浏览器Devtools-> Application -> Cookies 里找了🤔

公开密码访问的知识库

public_pwd

⚠️ 公开密码访问的知识库两种情况:

  • 已经登录语雀,访问需要密码的知识库 输入密码后使用_yuque_session这个cookie

    yuque-dl "url" -t "_yuque_session的值"
  • 未登录语雀,访问需要密码的知识库 输入密码后需要使用verified_books/verified_docs这个cookie

    yuque-dl "url" -k "verified_books" -t "verified_books的值"

内置启动web服务可快速预览

使用vitepress快速启动一个web服务提供可预览下载的内容

yuque-dl server ./download/知识库/

➜  Local:   http://localhost:5173/
➜  Network: use --host to expose

server

Feature

  • [x] 支持下载中断继续
  • [x] 支持图片下载本地
  • [x] 支持下载分享私有的知识库
  • [x] 支持转换表格类型的文档 (ps: 表格内插入图表暂不支持)
  • [x] 添加toc目录功能
  • [x] 添加测试
  • [x] 添加附件下载
  • [ ] 支持其他文档类型?🤔
  • [ ] 直接打包成可执行文件 🤔

常见错误

  1. 由于token可能含有 特殊字符导致参数识别错误
yuque-dl "https://www.yuque.com/yuque/thyzgp" -t "-a123"
yuque-dl [ERROR]: Unknown option `-1`

解决方案

yuque-dl "https://www.yuque.com/yuque/thyzgp" -t="-a123"
  1. 附件下载失败,需设置登录token

附件文件下载需要用户登录token,即使是完全公开的知识库,下载附件也可能需要

完全公开的知识库未登录的情况下查看附件:

attachments

Tips

由于网络波动下载失败的,重新运行即可,已下载的进度不会受到影响