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

methone

v0.7.7

Published

The worlds first Top-Bar-as-a-Service

Readme

Methone: The worlds first responsive topbar-as-a-service, or TBaaS

Because this is exactly what everybody really wanted.

All of datasektionen's systems should have the unified top bar. The TBaaS was created to ensure that all systems use the latest and greatest topbar.

Arch

Pages that wants the top-bar should include the main.js file into each page. The script loads configuration from the object methone_conf which must have been defined before including bar.js.

Fuzzyfiles

Methone provides fuzzy navigation on sites where deployed. For this to work, you might need to supply methone with an fuzzyfile, which describes what items it should be possible to search for. Once the bar is loaded, the bar will load the fuzzyfile (if specified) to learn how to fuzzy search pages on the site. Also, the master fuzzyfile will be loaded from the server.

How to use

Everything works best when the parent element is an immidiate child of the body tag. You should probably lower your page content by 50 pixels.

  <body>
    <div id="methone-container-replace"> <!-- Should be a direct child of body -->
    <nav>This will be replaced</nav>
    </div>
    ....

  <script>
    window.methone_conf = {
    system_name: "meta-tv",
    color_scheme: "cerise"
    login_text: "Login with trisslott", // Default null, null hides button
    login_href: "/login",
    links: [
      {
      str: "About us",
      href: "http://my.system.se/about-us",
      }, ...
    ]
    }
  </script>

  <script async src="//methone.datasektionen.se/bar.js"></script>
  <script>
    // The config can be updated dynamically!
    window.methone_conf.update({
    login_text: "Log out",
    login_href: "/logout"
    })
    // Only the provided keys will be updated.
  </script>

Usage as a React component

If you are building a React app it is possible to include Methone as a component directly. If you do this you will be able to also use React Router with top-bar navigation. Instead of defining a window.methone_conf you directly pass a config property on the Methone element.

  config = {
    system_name: "meta-tv",
    color_scheme: "cerise"
    links: [
    {
      str: "About us",
      href: "http://my.system.se/about-us",
    },
    <Link to="/">Home</Link>,
    <Link to="/some/href">str</Link>,
    {
      str: "Interchangable links should work",
      href: "/but/who?knows"
    }
    ]
  }

  return (
    <div>
    <Methone config={config} />
    <div>
      ...
    </div>
    </div>
  )

The implementation for Link elements is quite primitive, so they should probably follow the above format quite closely. If something else works, great, but dont count on it...

I want my links in the search!

There are two types of links, global and local. To add a global link do it need to be in the fuzzyfile.js of this repo, pull request are a good way to get your system to appear everywhere! If you want local links that are only available in your system methone looks for a fuzzyfile at /fuzzyfile. The content may be dynamically generated.

An example fuzzyfile: Search is performed on the str value.

  {
    "@type": "fuzzyfile",

    "fuzzes": [
    {
      "name": "Lokalbokning - Datasektionen.se",
      "str": "lokalbokning booking",
      "color": "#FDDE00",
      "href": "http://datasektionen.se/sektionen/lokalbokning"
    },
    {
      "name": "Mottagningen - Datasektionen.se",
      "str": "mottagningen",
      "href": "/sektionen/mottagningen"
    }
    ]
  }