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

vitepress-plugin-fullsearch

v1.0.2

Published

Zero-config full-text search plugin for VitePress with intelligent Chinese-English hybrid indexing

Downloads

319

Readme

vitepress-plugin-fullsearch

VitePress 全文搜索插件,提供开箱即用的智能搜索体验。

✨ 特性

  • 🚀 零配置使用 - 无需传递任何参数,默认配置即最优
  • 🔍 智能分词 - 支持中英文混合搜索,自动逐字符分词
  • 🎯 精准排序 - 多层排序优化,确保最相关的结果排在前面
  • 💡 友好预览 - 上下文预览,快速定位关键信息
  • 🎨 原生体验 - 完美集成 VitePress 默认主题

📦 安装

npm install vitepress-plugin-fullsearch

🚀 使用

最简单的方式(推荐)

// docs/.vitepress/config.mjs
import { defineConfig } from 'vitepress';
import { FullSearchPlugin } from 'vitepress-plugin-fullsearch';

export default defineConfig({
  vite: {
    plugins: [
      FullSearchPlugin(), // 无需任何参数!
    ],
  },
});

高级自定义(可选)

FullSearchPlugin({
  tokenize: 'full', // 全字匹配模式(默认)
  previewLength: 100, // 预览长度(默认 100)
  placeholder: '搜索文档...', // 占位符文本(默认)
  maxSuggestions: 10, // 最多显示结果数(默认)
});

🎯 核心功能

智能多策略搜索

  • 原始查询 - 精确匹配整个搜索词
  • 拆分查询 - 中英文分离,逐个匹配
  • 无空格查询 - 移除空格后的版本

中英文混合搜索

  • 自动识别中文和英文关键词
  • 中文逐字符分词,支持单字、双字、三字搜索
  • 英文保留完整单词,同时支持部分匹配
  • 空格容错,有无空格都能搜到

🔧 开发说明

默认配置

  1. tokenize: 'full' - 全字匹配模式,中文搜索更准确
  2. previewLength: 100 - 显示足够的上下文信息
  3. placeholder: '搜索文档...' - 友好的引导文本
  4. maxSuggestions: 10 - 平衡性能和用户体验

📄 License

MIT