Skip to content

Repository files navigation

File Search Tool / 文件搜索工具

English | 中文


English

An efficient file search tool based on Electron, featuring smart search algorithms and a user-friendly interface.

Features

Smart Search Algorithm

  • Scope Narrowing: Prioritizes subdirectories when matches are found in a directory.
  • Parallel Processing: Searches up to 3 subdirectories in parallel to fully utilize multi-core CPUs.
  • Batch Operations: Batches file info retrieval and result sending to reduce IPC overhead.
  • Avoid Duplicate Scanning: Automatically records scanned files to prevent redundant searches.
  • Depth-First Strategy: Prioritizes diving deeper into relevant directories upon finding matches.

File Type Filtering

  • Images: jpg, png, gif, svg, webp, etc.
  • Documents: pdf, doc, docx, txt, xlsx, ppt, etc.
  • Videos: mp4, avi, mkv, mov, etc.
  • Audio: mp3, wav, flac, aac, etc.
  • Archives: zip, rar, 7z, tar, etc.

Convenient Operations

  • Open Folder: Quickly open the file's directory in the system explorer.
  • View File: Open the file directly.
  • Properties: View detailed file information (size, creation time, modification time, etc.).
  • Keyword Highlighting: Automatically highlights matched keywords in search results.
  • Clear Results: One-click clearing of all search results.

Real-time Statistics

  • Number of files found
  • Number of files scanned
  • Search duration
  • Search progress animation

Quick Start

Development Environment

Install Dependencies

npm install

Start Program

npm start

Packaging

Install Builder

npm install --save-dev electron-builder

Build for Windows

npm run build:win

This generates:

  • Installer: dist/文件搜索工具 Setup 1.0.0.exe
  • Portable: dist/文件搜索工具-1.0.0-portable.exe

For detailed build instructions, see build-instructions.md.

Usage

  1. Enter the folder path to search (or click "Browse").
  2. (Optional) Enter keyword for filenames.
  3. (Optional) Select file types to search.
  4. Click "Search" to begin.
  5. View found files in the results list (keywords are highlighted).
  6. Use the right-side buttons to:
    • Open Folder
    • View File
    • Check Properties
  7. Click "Clear" to remove all search records.

Performance Optimization

  • Parallel Search: Up to 3 subdirectories concurrently.
  • Batch Processing: Retrieves and sends file info in batches (every 20 files or 500ms).
  • Smart Skip: Automatically skips system directories, development folders (node_modules, .git), and system files.
  • Performance Gains: 2-3x faster in directories with many small files, 3-5x faster in large structures.

Tech Stack

  • Electron 41.1.1
  • Node.js
  • HTML5 + CSS3
  • JavaScript (ES6+)

Project Structure

├── file-search.html         # Main UI
├── search-renderer.js       # Renderer process logic
├── search-main.js           # Main process logic (optimized search algorithm)
├── search-preload.js        # Preload script
├── package.json             # Project config
├── README.md                # Documentation
├── build-instructions.md    # Build instructions
└── .gitignore               # Git ignore file

Notes

  • Searching large directories may take time.
  • Some system directories might be skipped due to permission issues.
  • Specifying file types is recommended to improve efficiency.
  • First-time packaging requires downloading dependencies (may take a few minutes).

Changelog

v1.0.0 (2024)

  • Smart search algorithm
  • File type filtering
  • Keyword highlighting
  • Loading animations
  • Parallel search optimization
  • Batch processing optimization
  • Clear results feature
  • Real-time statistics

License

ISC

Author

Jocelyn


中文

一个基于 Electron 的高效文件搜索工具,具有智能搜索算法和友好的用户界面。

功能特点

智能搜索算法

  • 范围缩小优化:当在某个目录找到匹配文件时,优先搜索该目录的子目录
  • 并行处理:最多3个子目录并行搜索,充分利用多核CPU
  • 批量操作:批量获取文件信息和发送结果,减少IPC通信开销
  • 避免重复扫描:自动记录已扫描的文件,防止重复搜索
  • 深度优先策略:在找到匹配后,优先深入搜索相关目录

文件类型过滤

  • 图像文件:jpg, png, gif, svg, webp 等
  • 文档文件:pdf, doc, docx, txt, xlsx, ppt 等
  • 视频文件:mp4, avi, mkv, mov 等
  • 音频文件:mp3, wav, flac, aac 等
  • 压缩包:zip, rar, 7z, tar 等

便捷操作

  • 打开文件夹:快速在资源管理器中打开文件所在目录
  • 浏览文件:直接打开文件
  • 查看属性:查看文件详细信息(大小、创建时间、修改时间等)
  • 关键词高亮:搜索结果中自动高亮显示关键词
  • 清空结果:一键清空所有搜索结果

实时统计

  • 找到的文件数量
  • 已扫描的文件数量
  • 搜索耗时
  • 搜索进度动画

快速开始

开发环境

安装依赖

npm install

启动程序

npm start

打包发布

安装打包工具

npm install --save-dev electron-builder

打包 Windows 版本

npm run build:win

这会生成:

  • 安装版dist/文件搜索工具 Setup 1.0.0.exe
  • 便携版dist/文件搜索工具-1.0.0-portable.exe

详细打包说明请查看 build-instructions.md

使用方法

  1. 输入要搜索的文件夹路径(或点击"浏览"按钮选择)
  2. (可选)输入文件名关键词
  3. (可选)选择要搜索的文件类型
  4. 点击"搜索"按钮开始搜索
  5. 在结果列表中查看找到的文件(关键词会高亮显示)
  6. 使用右侧按钮进行操作:
    • 打开文件夹
    • 浏览文件
    • 查看属性
  7. 点击"清空结果"清除所有搜索记录

性能优化

并行搜索

  • 每次最多3个子目录并行搜索
  • 充分利用多核CPU性能
  • 大幅提升搜索速度

批量处理

  • 批量获取文件信息(使用 Promise.all)
  • 每20个文件或每500ms批量发送结果
  • 减少IPC通信和UI更新开销

智能跳过

  • 自动跳过系统目录(Windows、Program Files等)
  • 跳过开发目录(node_modules、.git等)
  • 跳过系统文件(pagefile.sys、swapfile.sys等)
  • 限制递归深度防止过深搜索

性能提升

  • 小文件密集目录:提升 2-3倍
  • 大型目录结构:提升 3-5倍
  • 多核CPU环境:提升更明显

技术栈

  • Electron 41.1.1
  • Node.js
  • HTML5 + CSS3
  • JavaScript (ES6+)

项目结构

├── file-search.html         # 主界面
├── search-renderer.js       # 渲染进程逻辑
├── search-main.js           # 主进程逻辑(优化的搜索算法)
├── search-preload.js        # 预加载脚本
├── package.json             # 项目配置
├── README.md                # 说明文档
├── build-instructions.md    # 打包说明
└── .gitignore               # Git忽略文件

注意事项

  • 搜索大型目录可能需要较长时间
  • 某些系统目录可能因权限问题无法访问(会自动跳过)
  • 建议搜索时指定文件类型以提高效率
  • 首次打包需要下载依赖,可能需要几分钟

更新日志

v1.0.0 (2024)

  • 智能搜索算法
  • 文件类型过滤
  • 关键词高亮
  • 搜索加载动画
  • 并行搜索优化
  • 批量处理优化
  • 清空结果功能
  • 实时统计显示

许可证

ISC

作者

Jocelyn


如有问题或建议,欢迎反馈!

About

An optimized, re-optimized, and re-optimized again file search tool for quickly finding files.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages