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

@crowi/plugin-search-mongo

v0.1.0-alpha.0

Published

Infra-free MongoDB $regex search driver for Crowi 2.0.

Downloads

81

Readme

@crowi/plugin-search-mongo

The default, infra-free search driver for Crowi 2.0. It searches live data — the Page collection and each page's current Revision — with a case-insensitive MongoDB $regex over path / title / body. No external service, no separate search index: MongoDB alone powers search.

This is what makes the slim deployment (local file storage + mongo search) searchable out of the box, with MongoDB as the only required infrastructure.

When to use

  • ✅ Small / mid-size wikis that don't want to run Elasticsearch / OpenSearch.
  • ✅ Japanese (and other CJK) content: a $regex substring match is more practical than MongoDB $text, whose CJK tokenisation is weak.
  • ❌ Large installs. A non-anchored $regex cannot use an index, so search scans the collection. Run @crowi/plugin-search-elasticsearch instead at scale.

How it works

  • No index maintenance. index() and remove() (called from the page-saved hook) are no-ops; there is nothing to keep in sync because the page body already lives in Page / Revision. rebuild() is omitted.
  • Two-pass query. Path/title hits (the page title is its path) are found first, then body hits are resolved via a single bulk Revision.find({ revision: { $in }, body: regex }) over the viewer-visible candidate pages (capped at CANDIDATE_CAP = 5000 to bound the scan). Path hits rank ahead of body-only hits.
  • Grant-aware. Results respect page visibility: anonymous viewers see public pages only, admins see everything, and other viewers see public pages plus pages they created or that are shared with them. Drafts, deleted pages and redirects are always excluded.
  • Snippets. Best-effort substring around the first match, with the match wrapped in <mark>. Not HTML-escaped — the web client sanitises before render.

Configuration

None. The driver uses the same MongoDB connection as the rest of the app, so its configSchema is empty. Select it with search.driver: 'mongo' in the runner's crowi.config.json (this is the schema default).