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

dsh-file-opener

v1.4.0

Published

DSH 插件:对话里的文件与目录路径点一下就打开——可预览的在右侧侧边栏显示,其余用系统默认程序打开。

Readme

dsh-file-opener

把 DSH 对话中出现的文件和目录路径变成可点击按钮:点击即可在右侧侧边栏预览,或调用系统默认程序打开。

功能

| 操作 | 结果 | |---|---| | 点击文件路径 | 右侧侧边栏可显示则在侧边栏打开,否则调用系统默认程序 | | Shift + 点击文件路径 | 强制调用系统默认程序 | | 点击目录路径 | 用资源管理器打开该目录 | | 点击路径后的文件夹图标 | 文件:打开其所在目录;目录:打开该目录本身 | | 点击不存在的路径 | 打开其所在的那一级真实目录,不报错 |

  • 可识别的路径写法:绝对路径、~/...(展开为当前用户主目录)、./ 与 ../(按会话工作目录解析)。
  • 用户消息中未附带官方按钮的行内代码,只要内容是路径,同样可点击并带文件夹图标。
  • 打开失败会给出可见提示,不会静默失败。

安装

web 版

dsh plugin --profile web add dsh-file-opener

桌面版

  1. 打开 DSH 桌面版,点击左侧栏「插件」。
  2. 点击「添加插件」。
  3. 输入包名 dsh-file-opener,点击「安装」,等待完成。
  4. 安装完成后点击「立即启用」,并在「已安装」中确认其开关为打开状态。

让 AI 输出可点击的路径

插件识别的是行内代码(反引号包裹)中的路径文本。若要让 AI 回复中提到的文件可以直接点击打开,请在 agent 指令文件(如 AGENTS.md)中要求 AI 写出完整路径,例如:

回复中提到的每个文件或目录,都必须用反引号包裹完整绝对路径,例如 `C:\work\报告.md`。
不要只写文件名,也不要只给目录再另写文件名。

点击后的打开方式

点击文件路径时按以下顺序判断:

  1. 路径不存在 → 打开其所在目录。
  2. 路径是目录 → 用资源管理器打开。
  3. 路径是文件:
    1. 内容为纯文本 → 右侧侧边栏;
    2. 否则查询官方预览器注册表,命中 → 右侧侧边栏;
    3. 均未命中 → 系统默认程序。

是否纯文本只按内容判断:读取文件开头 4 KB,无 NUL 字节且可按 UTF-8 解码即为纯文本,与扩展名无关。

在右侧侧边栏打开

Markdown(md、markdown)、HTML(html、htm)、图片(png、jpg、jpeg、gif、webp、bmp、ico、svg)、PDF(pdf)、Office(doc、docx、ppt、pptx)、Excel(xlsx、xls、csv、tsv)、代码高亮(官方代码语言表内的全部后缀,如 ts、js、py、go、rs、java、c、cpp、cs、php、sh、bat、ps1、yaml、toml、sql、xml、css),以及任何内容为纯文本的文件(如 txt、log、dxf)。

用系统默认程序打开

dwg、psd、ai、skp、max、zip、7z、rar、mp3、mp4、exe、msi、lnk、iso、tif、tiff、avif 等:压缩包、音视频、安装程序、磁盘映像,以及官方未提供预览器的二进制格式。

两种容易被误认为故障的情况

  • .dxf:DXF 为文本格式,按纯文本处理,在侧边栏显示源码,不会启动 CAD。需用 CAD 打开时按住 Shift 点击。
  • .docx、.xlsx、.pptx:官方 0.2.0-rc.2 自带 Office 与 Excel 预览器,在侧边栏打开,不会启动 Office。此属预期行为。

Office 与 Excel 的侧边栏预览依赖宿主转换组件,转换失败时仅显示「无法预览」,不会自动改用系统程序;此时按住 Shift 点击即可。

已知限制

  • 目录打开仅支持 Windows;其他平台退回侧边栏打开。
  • UNC 网络路径(\\server\share)与 Windows 保留设备名(CON、PRN、AUX、NUL、COM1-COM9、LPT1-LPT9)不予打开。
  • 相对路径无绝对路径可用,仅能通过侧边栏打开;Shift 强制系统程序对其无效。
  • 工作区外的路径交给侧边栏预览时,可能因宿主访问策略返回 403,文件过大可能返回 413;此时按住 Shift 点击用系统程序打开。
  • 权限不足的路径会被视为不存在,表现为打开其上级目录。
  • 文件名以单引号或反引号结尾时,该字符会被当作标点去掉。

许可

MIT,见 LICENSE。