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 🙏

© 2025 – Pkg Stats / Ryan Hefner

netlify-plugin-opensearch

v1.0.4

Published

Automatically generate opensearch search.xml file postBuild on Netlify deploy

Readme

Netlify Opensearch Plugin

Automatically generate OpenSearch search.xml file postBuild on Netlify deploy.

What is this?

Ever wondered why when you type a URL and the browser says "press TAB to search"? That's opensearch! In Chrome or Chromium, the URL bar (or Omnibox) offers the ability to search a site without navigating to the sites homepage. Once Chromium has determined it can search a site, any time the user types the URL of the site the user is reminded they can "press TAB to search".

Once the user presses TAB, they can type in a string and presses the enter. This automatically sents the user to the URL of the site search, along with their search terms, where the search is performed and results shown.

Type in the URL of the search demo site and see! https://netlify-plugin-algolia-index.netlify.app

Screenshot 2020-06-24 at 08 58 25

Then press TAB and you can search the demo site directly!

Screenshot 2020-06-24 at 08 58 30

Usage

To install, add the plugin in your netlify.toml. No config is required.

[[plugins]]
  package = "netlify-plugin-opensearch"

Default config will generate the following file at https://your-site-name.netlify.app/search.xml

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Search</ShortName>
  <Url type="text/html" template="https://your-site-name.netlify.app/search?q={searchTerms}"/>
</OpenSearchDescription>

Options

The available options.

| plugins.inputs | type | required | default | description | |---|---|---|---|---| | searchUrl | String | false | <env.URL>/search?q= | The URL of the search query, remembering that the search parameters are concatenated to the end as {searchTerms} | | searchFile | String | false | search.xml | The name of the file to be saved to. You'll need to configure your metadata to point to this file. | | siteShortName | String | false | Search | A short name of the site to search. It must be 16 or fewer characters | | siteDescription | String|null | false | null | A description of the site to search. It must be 1024 or fewer characters | | siteTags | String|null | false | null | Comma separated list of keywords and strings | | siteContact | String|null | false | null | Email address to contact the site |

Options Applied

How to use these options:

[[plugins]]
  package = "netlify-plugin-opensearch"
    [plugins.inputs]
      searchUrl = "https://different-website.com/search?q="
      searchFile = "opensearch.xml"
      siteShortName = "My Site"
      siteDescription = "Search cool content from my site"
      siteTags = "my site"
      siteContact = "[email protected]"

Which will produce the following file at https://your-site-name.netlify.app/opensearch.xml:

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>My Site</ShortName>
  <Url type="text/html" template="https://different-website.com/search?q={searchTerms}"/>
  <Description>Search cool content from my site</Description>
  <Tags>my site</Tags>
  <Contact>[email protected]</Contact>
</OpenSearchDescription>

Options On the Demo Site

For more context, this is how the demo site is configured:

[[plugins]]
  package = "netlify-plugin-opensearch"
    [plugins.inputs]
      siteShortName = "Demo Site"
      siteDescription = "Find stuff on the demo site"
      siteTags = "demos"
      siteContact = "[email protected]"

Which produced the following file as you can see here

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Demo Site</ShortName>
  <Url type="text/html" template="https://netlify-plugin-algolia-index.netlify.app/search?q={searchTerms}"/>
  <Description>Find stuff on the demo site</Description>
  <Tags>demos</Tags>
  <Contact>[email protected]</Contact>
</OpenSearchDescription>

Install on your website

Now, a search metatag to the head of your site, changing search.xml to match your configuration above.

<link rel="search" href="search.xml" type="application/opensearchdescription+xml" title="Your Site Name" />

To do

Contributing

Make pull-requests, but follow code of conduct please.