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

@algolia/sitesearch

v1.0.12

Published

Opinionated site search modal for the web. Ships zero-build CDN bundles (JS + CSS) and a one-line init API. Powered by Algolia InstantSearch.

Readme

@algolia/sitesearch

Opinionated site search modal for the web. Ships zero-build CDN bundles (JS + CSS) and a one-line init API. Powered by Algolia InstantSearch.

Features

  • Modal search UI with keyboard shortcut (Cmd/Ctrl+K)
  • Infinite hits list with highlighted matches and optional images
  • Clean light/dark themes with CSS variables
  • Zero-build usage via unpkg CDN (script + link tag)
  • Optional Ask AI mode that streams AI answers with inline search tool feedback

Quickstart (CDN / no build)

Add CSS + JS from unpkg, then initialize.

<!-- CSS -->
<link rel="stylesheet" href="https://unpkg.com/@algolia/sitesearch@1/dist/search.min.css" />

<!-- JS (UMD exposes window.SiteSearch) -->
<script src="https://unpkg.com/@algolia/sitesearch@1/dist/search.min.js"></script>

<div id="search-root"></div>

<script>
  // Minimal config – replace with your own Algolia credentials
  window.SiteSearch.init({
    container: '#search-root',
    applicationId: 'ALGOLIA_APP_ID',
    apiKey: 'ALGOLIA_SEARCH_API_KEY',
    indexName: 'YOUR_INDEX_NAME',
    // Optional UX tweaks
    placeholder: 'What are you looking for?',
    hitsPerPage: 8,
    keyboardShortcut: 'cmd+k', // or 'ctrl+k', 'alt+k', etc.
    darkMode: undefined, // true, false, or leave it empty
    attributes: {
      primaryText: 'title', // required primary text
      secondaryText: 'description', // optional secondary text
      tertiaryText: "itunesAuthor", // optional tertiary text
      url: "url" // optional url attribute
      image: 'image', // optional URL attribute
    },
    // Optional: Transform items before rendering (e.g., proxy images)
    transformItems: (items) => 
      items.map(item => ({
        ...item,
        image: item.image ? `https://your-proxy.com/${item.image}` : item.image
      }))
  });
</script>

Theming

The widgets use CSS variables. Override them globally or within a wrapper.

/* Light (default) */
.ss-exp, .modal-backdrop, .sitesearch-button {
  --search-primary-color: #003dff;
  --search-background-color: #f5f5fa;
  --search-text-color: #23263b;
  /* ...more variables... */
}

/* Dark: either pass darkMode: true or add .dark to <html> */
.ss-exp.dark, .modal-backdrop.dark, .sitesearch-button.dark {
  --search-primary-color: #7aa2ff;
  --search-background-color: #202127;
  --search-text-color: #e5e7eb;
}

Key variables include:

  • --search-primary-color
  • --search-background-color
  • --search-neutral-color
  • --search-border-color
  • --search-input-font-size
  • --search-results-max-height

Tip: The components auto-detect dark mode if html.dark is present or if the OS prefers dark, unless darkMode is explicitly set.

Transform Items

The transformItems option allows you to modify search results before they are rendered. This is useful for:

  • Proxying images – Work around CORS issues or use a CDN
  • Formatting data – Transform dates, prices, or other fields

Accessibility & Keyboard

  • Open: Cmd/Ctrl+K (configurable via keyboardShortcut)
  • Navigate: Up/Down
  • Close: Escape or close button
  • Focus styles and aria-selected states are included out of the box

License

MIT

References

  • unpkg CDN docs: https://unpkg.com/