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

@exiahuang/filehub

v1.0.2

Published

FileHub: Instant Search & Preview across Private Cloud

Readme

FileHub Server

基于 Node.js 和 React 构建的跨平台文件搜索与预览服务器。提供 Web 界面,支持即时文件搜索、预览和访问,局域网内任意浏览器均可使用。

功能特性

  • 即时搜索 — 支持字符串、模糊、正则三种搜索模式,毫秒级响应
  • 文件预览 — 支持 PDF、图片、视频、音频、Office 文档(xlsx/docx)、Markdown、代码高亮
  • 局域网访问 — 将文件索引共享给同网络的其他设备
  • 二维码 — 扫码即可在手机上打开
  • 灵活配置 — 自定义索引目录和排除规则
  • 深色/浅色主题
  • REST API — 所有功能均可通过 HTTP API 调用

环境要求

  • Node.js 18+
  • npm 9+

安装

方式一:Docker(推荐)

# 拉取并运行最新版本
docker pull exiahuang/filehub-server:latest
docker run -d -p 6543:6543 -v /你的数据目录:/data exiahuang/filehub-server:latest

然后在浏览器中打开 http://localhost:6543

方式二:源码安装

git clone https://github.com/filehub1/filehub-server.git
cd filehub/server
npm install
npm run build

启动

# 启动服务器(默认端口 6543)
npm start

# 开发模式(热重载)
npm run dev

# 纯 Web 模式(不依赖 Electron)
npm run dev:web

配置

创建 ~/.filehub(YAML 格式):

indexedDirectories:
  - /home/user/Documents
  - /home/user/Projects
serviceAddress: 0.0.0.0:6543
excludePatterns:
  - node_modules
  - .git
  - dist
  - "*.log"

配置项说明

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | indexedDirectories | string[] | [] | 需要索引的目录列表 | | serviceAddress | string | 0.0.0.0:6543 | 服务监听地址 | | uiAddress | string | 0.0.0.0:6544 | 开发 UI 服务地址 | | excludePatterns | string[] | [] | 跳过的文件/目录规则 | | useAdminMode | boolean | false | 启用管理员模式 |

命令行参数覆盖

node dist/main/web-server.cjs --dir=/home/user/Documents
node dist/main/web-server.cjs --service-address=0.0.0.0:8080

使用方法

  1. 浏览器打开 http://localhost:6543
  2. / 聚焦搜索框
  3. 输入关键词,结果即时显示
  4. Enterl 打开文件
  5. o 切换预览面板
  6. \ 切换搜索模式(字符串 / 模糊 / 正则)

键盘快捷键

| 按键 | 功能 | |------|------| | / | 聚焦搜索框 | | j / | 向下移动 | | k / | 向上移动 | | Enter / l | 打开文件 | | o | 切换预览 | | O | 在资源管理器中打开 | | \ | 切换搜索类型 | | r | 重建索引 | | s | 设置 | | ? | 帮助 |

API 接口

| 接口 | 方法 | 说明 | |------|------|------| | /api/search?query=&searchType=string | GET | 搜索文件 | | /api/config | GET | 获取当前配置 | | /api/config | POST | 更新配置 | | /api/rebuild | POST | 重建索引 | | /api/preview?path= | GET | 获取文件预览 | | /api/status | GET | 索引状态 |

构建原生插件(仅 Windows)

通过 Windows MFT/USN Journal 实现更快的索引速度:

cd src/addon
node-gyp configure
node-gyp build

许可证

MIT