🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

staticsearch

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

staticsearch

Simple static site search system.

latest
Source
npmnpm
Version
0.8.1
Version published
Weekly downloads
37
-2.63%
Maintainers
1
Weekly downloads
 
Created
Source

StaticSearch

StaticSearch is a simple search engine you can add to any static website. It uses client-side JavaScript and JSON data files so there's no need for back-end server technologies or databases.

StaticSearch works with Publican sites but you can use it with any static site generator that outputs HTML pages. It works best on English sites, but supports most Latin-based languages.

Full documentation is available at staticsearch.com

View the CHANGELOG for updates

To use StaticSearch, build your static site to a directory, then:

Index your site

Assuming you've generated your static site to a sub-directory named ./build/, run the StaticSearch CLI command:

npx staticsearch

StaticSearch creates a new directory named ./build/search/ containing JavaScript code and word index data.

If your site is in a different directory, such as ./dist/, use:

npx staticsearch --builddir ./dist/

For help, refer to StaticSearch indexer or view CLI configuration help:

npx staticsearch --help

environment variable configuration help:

npx staticsearch --helpenv

or Node.js API configuration help:

npx staticsearch --helpapi

Add search functionality to your site

StaticSearch provides four ways to add a search facility on your site. The easiest is a single <script> tag placed inside your pages perhaps in the HTML <header>:

<script type="module" src="/search/staticsearch-here.js"></script>

This displays a icon in the script's location on the page that opens a search dialog when clicked.

If necessary, you can now rebuild your site to include this update and re-run the indexer to ensure word indexes are up-to-date.

For full help, refer to:

Keywords

static

FAQs

Package last updated on 13 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts