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

index-search

v1.1.0

Published

单字字典倒排式关联索引的静态资源搜索方案

Downloads

4,841

Readme

index-search

单字字典倒排式关联索引的静态资源搜索方案。

曾经我做过RavelloH/RPageSearch,也是静态站的全文搜索引擎,实现方式是先把所有资源拉取到本地,由js进行搜索。优点是只需要静态资源托管,不需要服务器参与运算,但是效率太低,内容多了之后文件大小爆炸。

这个项目是一个改进版,将每个字作为键来索引文章,会生成<全文中字的种类>个json,每个json中记录某个字在某篇文章的某个部分出现,前端只需要请求<搜索词长度>次即可进行搜索,而不用获取全文。

尤其适合中文这种字种多的语言,对纯英文用处不大。主要对“不是每篇文章都能用到”的字有效果,且作为索引,只能告诉你哪个内容中有你输入的搜索词,要获取那篇文章的全文需要再自行请求。

典型情况下,中文新闻语料库RavelloH/EverydayNews的data文件夹大小为1,738,276字节(1.65MB)时,会生成25,184,701(24.0MB)字节的索引,包含3773个json文件,平均每个文件的大小为6674字节(6.51KB),需要请求的文件大小降低至原来的(字数*6674)/1738276。典型赋值,字数为2-10时,降低至原来的0.0076-0.0383倍,提升高达2610%-13157%,效果显著。