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

mafiu

v1.0.10

Published

A super minimal framework for people who like native Web Components but need a little more convenience. Sadly, given how many frameworks are out there already, My Awesome Framework Is Unnecessary.

Readme

MAFIU (My Awesome Framework Is Unnecessary)

Overview

It was only a matter of time before I decided that what the world really needed was another frontend framework. The plan here is to do as little as possible to make Web Components more framework-like to work with. Using MAFIU is the same as using native Web Components, just with a little more built-in stuff.

  • Every component has a built-in state.
  • The component automatically updates when the state updates. MAFIU automatically provisions getObservedAttributes and attributeChangedCallback for you.
  • Component state change callbacks powered by Proxies.

And that's it. Those are the only features, because Web Components themselves should do most of the heavy lifting.

Implementation

When registering a custom Web Component, you extend a class and overload some methods. This usually looks something like:

window.customElements.define("your-component-name", class extends HTMLElement {
  static getObservedAttributes() {
    return ["a", "list", "of", "attributes", "that", "should", "trigger", "attributeChangedCallback"]
  }
  attributeChangedCallback(name, oldValue, newValue) {
    // Update the component HTML, call APIs, whatever
    doStuff(name, newValue)
  }
  constructor() {
    // Initialize internal state, set HTML, etc.
  }
  onConnectedCallback() {
    // Do stuff when element is added to the DOM
    // This is when attributes become available
  }
})

MAFIU just creates a Web Component under the hood, but lets you be way more declarative:

registerMafiuComponent({
  name: "your-component-name",
  template: "<div>Some arbitrary HTML string with references to the state variables: {{state}}</div>"
  data: {
    "your": "component",
    "state": "data"
  },
  hooks: {
    "state": [
      (value) => console.log("Oh look, someone updated the state: ", value)
    ]
  }
})

This will generate an anonymous class similar to the previous snippet and call window.customElements.define automatically. The other important thing going on here is that the data value is actually optional. It's only needed if you want to provide initial/default values or if you have a hidden state. Otherwise, the state variables can be inferred from the template itself.

Usage

In the simplest case, your component registration could look something like this:

// In a file called user-profile.js
{
  const name = "user-profile"
  const template = `
    <image class="profile-picture" src="{{userPicture}}"/>
    <div class="user-name">{{userName}}</div>
  `
  registerMafiuComponent({
    name,
    template
  })
}
<!--When using your component-->
<user-profile userPicture="//uri-of-profile-picture.com" userName="Matthew Bernardo"/>

In this example, information would get processed as follows:

  • The programmer will see the name of the component
  • The programmer will see the markup that defines the appearance of the component.
  • The programmer will see the names of the state variables.

This is (subjectively) a good information digestion process.

Demo

Want to see a site that is completely vanilla except for some Mafiu components? Check this out.