# pagefind

> Implement search on any static website.

Latest version **1.5.2** (published 2026-04-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install pagefind
pnpm add pagefind
yarn add pagefind
bun add pagefind
```

Provides the command `pagefind`.

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.5.2 |
| Published | 2026-04-12 |
| First published | 2022-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 36.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5458 |
| Author | Pagefind |
| Maintainers | bglw |
| Keywords | jamstack, static, search, pagefind, page, find |

## Links

- npm: https://www.npmjs.com/package/pagefind
- Repository: https://github.com/Pagefind/pagefind
- Homepage: https://github.com/Pagefind/pagefind#readme
- Issues: https://github.com/Pagefind/pagefind/issues
- npm.io page: https://npm.io/package/pagefind

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.5.2 (latest) — 2026-04-12
- 1.5.0-beta.2 (beta) — 2026-04-03
- 1.5.0-alpha.4 (alpha) — 2026-01-11
- 1.4.0-rc.3 (rc) — 2025-09-01
- 1.5.0 — 2026-04-06
- 1.5.0-beta.1 — 2026-01-11
- 1.5.0-alpha.3 — 2025-12-26
- 1.5.0-alpha.2 — 2025-10-17
- 1.5.0-alpha.1 — 2025-10-17
- 1.4.0 — 2025-09-01
- 1.4.0-rc.2 — 2025-09-01
- 1.4.0-rc.1 — 2025-09-01
- 1.4.0-alpha.1 — 2025-01-27
- 1.4.0-alpha.0 — 2025-01-19
- 1.3.0 — 2024-12-18
- … 105 more at https://npm.io/package/pagefind/versions

## README

# Pagefind Static Search

Pagefind is a fully static search library that aims to perform well on large sites, while using as little of your users’ bandwidth as possible, and without hosting any infrastructure.

The full documentation on using Pagefind can be found at https://pagefind.app/.

This packages houses a wrapper for running the precompiled Pagefind binary, and also serves as a NodeJS indexing library that can be integrated into existing tools.

## Running Pagefind through NPX

This is the recommended way of running Pagefind on a static site.

```bash
npx pagefind --site "public"
```

For more details on using the Pagefind binary, see [Installing and running Pagefind](https://pagefind.app/docs/installation/#running-via-npx), and the rest of the Pagefind documentation.

## Using Pagefind as a Node library

This package also provides an interface to the Pagefind binary directly as a package you can import.

```js
import * as pagefind from "pagefind";

// Create a Pagefind search index to work with
const { index } = await pagefind.createIndex();

// Index all HTML files in a directory
await index.addDirectory({
    path: "public"
});

// Add extra content
await index.addCustomRecord({
    url: "/resume.pdf",
    content: "Aenean lacinia bibendum nulla sed consectetur",
    language: "en",
});

// Get the index files in-memory
const { files } = await index.getFiles();

// Or, write the index to disk
await index.writeFiles({
    outputPath: "public/pagefind"
});
```

For more details on using Pagefind as a library, see [Indexing content using the NodeJS API](https://pagefind.app/docs/node-api/).

---
_Source: https://npm.io/package/pagefind · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
