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-fff

v0.1.0

Published

Fuzzy file finding and indexed content search for DSH: find_files / resolve_file / related_files / fff_grep. Pure-JS path index + subsequence scoring (no native dependencies). Port of pi-fff for the Pi coding agent.

Readme

dsh-fff

模糊文件查找 + 索引内容搜索——DSH 插件,移植自 Pi Coding Agent 生态的 pi-fff(FFF = fast fuzzy finder)。

功能

| 工具 | 说明 | |---|---| | find_files | 模糊路径搜索(fzf 风格多 token:空格分隔、每个 token 必须命中;basename 计双倍、目录段计半,连续片段加分),返回排序路径列表 | | resolve_file | 模糊引用 → 单个精确路径(并列给出 runner-up,暴露歧义),结果可直接喂给 read/replace | | related_files | 相关文件:同 stem(.test.ts/.spec.ts/实现配对)→ 同目录 → 兄弟目录 | | fff_grep | ripgrep 内容搜索(regex/字面量、模糊 scope、glob 过滤),结果按文件分组带计数 |

索引:纯 JS 递归遍历工作区(fs.listDir),跳过 .git/node_modules/dist/build 等目录,5 万文件 / 16 层上限;60 秒 TTL 缓存。零 npm 依赖(Pi 原版用原生 @ff-labs/fff-node,动态插件不能 require npm 包,故纯 JS 重写;中型项目性能足够)。

内容搜索:走 subprocess 服务调用 ripgrep(rg --no-heading --line-number);rg 未安装时给出明确错误并提示使用内置 grep 工具。

安装

  • npm bundle(官方标准分发):发布到 npm 后 dsh plugin --profile <name> add dsh-fff(包声明 dsh.bundle,安装时自动加入 bundle 层)。
  • 动态插件:cordis_define(code.host = src/host.js 逐字)→ cordis_run。
  • 静态挂载:index.js 以普通 Node 模块加载同一函数体(内含 harness/staticDefineTool 双模式适配);部署位置 ~/.dsh/profiles/web/plugins/dsh-fff/ + cordis.patch.yml insert 行。
  • 插件声明 inject: ['fs', 'tools', 'systemPrompt', 'subprocess'],静态加载时等这些服务就绪后才 apply。

开发

npm test   # 15 用例:子序列打分、多 token、basename/目录权重、排序/截断、相关文件、搜索结果分组、静态求值、工具注册

与 pi-fff 的差异

  • 无原生索引库:纯 JS 路径索引 + 子序列打分(原版为 C++ FFF 索引 + 后台 watcher);
  • 无编辑器 @... 补全(DSH 聊天输入没有该机制;如需浏览器端文件选择器 UI 可后续加 Client Slot);
  • read/grep 工具覆盖不做(DSH 内置工具行为不同,模糊解析通过 resolve_file/fff_grep 显式提供)。

参考