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

tl-search

v0.1.5

Published

纯 Rust 中文全文搜索引擎

Readme

tl-search

纯 Rust 手搓的超快中文全文搜索引擎

npm
size
license
Rust

安装

npm install tl-search

极简使用(3 行搞定)

import init, { TlSearch } from 'tl-search';

await init();
const search = new TlSearch();

// 添加文档
search.add("1", "Rust 编程语言", "Rust 是一门系统编程语言,注重安全与性能");
search.add("2", "学习 Rust 的好处", "零成本抽象、无数据竞争、并发安全");

// 搜索
const results = search.search("rust 安全", 10);
console.log(results);
// → [
//   { id: "1", title: "Rust 编程语言", score: 2.77, positions: [0, 13, 37] },
//   ...
// ]

// 前缀建议
const hints = search.suggest("ru");
console.log(hints);
 // → ["Rust 编程语言", "学习 Rust 的好处"]

核心特性

  • 100% 手搓实现(无 tantivy / tinysearch / lunr)
  • 完美中文分词(jieba-rs)
  • TF-IDF + 标题加权排序
  • 前缀自动建议(输入 ru → 自动提示标题)
  • 支持增量添加/删除文档
  • 零 native 依赖,可直接在浏览器运行

适用场景

  • 静态博客搜索(VitePress、Docusaurus、Astro、Hexo)
  • 文档站本地搜索
  • 前端离线搜索
  • 任何对性能极致的中文搜索需求

License

MIT License © tl1015