MiniSearch

Tiny, dependency-free in-memory full-text search engine for browser and Node

Library
npm
v7.2.0
6,174 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
38 /100 Needs Attention
Development Activity 0
Maintenance 0
Community 52
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
79 /100 Good
Architecture 78
Code Quality 82
Innovation 75
Learning Curve 80

MiniSearch is a lightweight, in-memory full-text search engine for JavaScript and TypeScript that runs comfortably in both Node and the browser, including memory-constrained mobile browsers. It supports exact match, prefix search, fuzzy matching, field boosting, and auto-suggestion, making it a popular choice for client-side “search as you type” experiences that need to work offline without a server round-trip.

With zero external runtime dependencies and a compact, well-tested codebase built around an efficient SearchableMap trie-like index, MiniSearch trades the scale of a hosted search service for speed, offline capability, and simplicity — documents can be added or removed from the index at any time, and the whole index can be serialized to JSON for persistence or transfer.

What You Get

  • The MiniSearch class for building, updating, and querying an in-memory full-text index
  • Exact match, prefix search, and fuzzy (edit-distance-based) matching, each independently configurable
  • Field boosting and per-term/per-document custom boost functions for tuning result ranking
  • An auto-suggestion engine (autoSuggest) for query auto-completion
  • JSON serialization/deserialization of the whole index via toJSON/loadJSON for persistence or transfer between processes

Common Use Cases

  • Real-time ‘search as you type’ in web and mobile apps, keeping the index client-side to avoid server round-trips
  • Offline-capable search in Progressive Web Apps or Electron apps where no search backend is available
  • Adding full-text search to static sites (docs, blogs) by shipping a prebuilt JSON index to the browser
  • Auto-complete/auto-suggest features that need typo tolerance and field-weighted ranking without a hosted search service

Under The Hood

Architecture MiniSearch centers on a single ~2,300-line MiniSearch class (src/MiniSearch.ts) composed with a custom SearchableMap (src/SearchableMap/SearchableMap.ts), a radix-tree-like structure optimized for prefix and fuzzy lookups over string keys. Documents are tokenized per configured fields, terms are inserted into the SearchableMap alongside per-document term frequency data, and search queries combine exact/prefix/fuzzy matching strategies (each independently weighted) with a TF-IDF-style scoring and boosting pipeline (field boost, term boost, document boost) before results are ranked and returned. The whole index can be serialized to and rehydrated from JSON via toJSON/loadJSON, letting a prebuilt index be shipped to a browser instead of built client-side.

Tech Stack Written entirely in TypeScript with zero runtime dependencies, bundled via Rollup into ESM, CommonJS, and UMD builds (dist/es, dist/cjs, dist/umd) so it can be dropped into either bundler-based projects or loaded directly via unpkg/jsdelivr in a browser. Types are hand-authored and exported from dist/es/index.d.ts, and API docs are generated with TypeDoc (typedoc.json).

Code Quality The project has an 80KB Jest-style test file (src/MiniSearch.test.js) alongside dedicated tests for SearchableMap, and CI badges show coverage tracking via Coveralls — indicating a genuinely well-tested core rather than a thin smoke-test suite. The single large MiniSearch.ts file is dense but consistently documented with JSDoc comments on nearly every public option and method, which keeps the surface navigable despite its size.

API Design The public API centers on one class with a small number of well-named methods (add, addAll, remove, search, autoSuggest) and richly typed options objects (SearchOptions, Options) that let simple use cases work with defaults while exposing deep customization (custom tokenizers, term processors, per-term/per-document boost functions) for advanced needs — a classic ‘simple things simple, complex things possible’ design that keeps the getting-started boilerplate to a single new MiniSearch({ fields: [...] }) call.

Used by 14 apps in this directory

TypeScript
87%
MIT

medusa

Ecommerce

36,897

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
94
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 87%
JavaScript 12%
Updated 6 days ago
JavaScript
64%
AGPL 3.0

overleaf

Collaboration · Productivity

18,266

Open-source, real-time collaborative LaTeX editor with sandboxed compilation and full TeXLive support for self-hosted academic and research teams.

View details
84
Repo Health
80
Technical
59
Dependency
Built with
JavaScript 64%
TypeScript 30%
Updated 1 months ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

40,397

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 5 days ago
TypeScript
64%
AGPL 3.0

Puter

Developer Tools · File Storage

43,864

A self-hostable, web-based internet OS with desktop GUI, cloud storage, AI drivers, and a developer SDK — all running in your browser.

View details
88
Repo Health
88
Technical
67
Dependency
Built with
TypeScript 64%
JavaScript 33%
Updated 5 days ago
Go
66%
GPL 3.0

Stormkit

Devops · Hosting Control Panel

264

Self-hostable platform for deploying and hosting modern web apps with automated CI/CD, custom domains, and a built-in serverless runtime — a true open-source alternative to Vercel and Netlify.

View details
80
Repo Health
79
Technical
67
Dependency
Built with
Go 66%
TypeScript 31%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers