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

mixter

v0.3.1

Published

A Web Components framework.

Readme

A Web Components framework.

Examples

/** @jsxImportSource mixter/jsx */
import { create } from 'mixter'
import { jsx } from 'mixter/jsx'

export const App = create(
  class {
    who = 'world'
  },
  ({ $ }) => {
    const { render } = jsx($)
    render(({ who }) => <div>Hello, {who}!</div>)
  }
)
/** @jsxImportSource mixter/jsx */
import { attrs, css, event, events, mixter, props, shadow, state } from 'mixter'
import { jsx, refs } from 'mixter/jsx'

type Todo = {
  name: string
  done: boolean
}

export class TodoApp extends mixter(
  // Extend basic HTMLElement
  HTMLElement,
  // Attach ShadowRoot
  shadow(),
  // Declare the events we will be emitting, this allows for
  // `el.onsomeevent = fn` to be statically typed
  events<{
    done: CustomEvent<{ todo: Todo }>
  }>(),
  // Element attributes, can be String, Number, Boolean
  attrs(
    class {
      name = 'My todos!'
      background = '#446'
      todoColor = '#fff'
      doneColor = '#999'
    }
  ),
  // Declare properties, can be any type
  props(
    class {
      form?: HTMLFormElement
      textInput?: HTMLInputElement
      todos: Todo[] = [
        { name: 'create todo list', done: true },
        { name: 'wow todo list', done: false },
        { name: 'so much todo', done: false },
      ]
      onTodoCleanup?: () => void
      onTodoAdd?: () => void
      onTodoChange?: (todo: Todo) => (
        e: Event & { currentTarget: HTMLInputElement },
      ) => void
    }
  ),
  // Reactive state handler
  state<TodoApp>(({ $, effect, reduce }) => {
    // Use jsx, returns the render function which acts like a `reduce`
    // that instead renders on the root element.
    const { render } = jsx($)
    // Use refs, `ref.someElement` can now be passed to `ref=` attributes in JSX.
    // Refs are bidirectional, meaning if they already have a reference, passing them to
    // a JSX element will "give" that element by reference, instead of filling "from" it.
    const { ref } = refs($)

    $.onTodoAdd = reduce(({ textInput, todos }) => (event().prevent.stop(() => {
      $.todos = [mixter.todos, { name: textInput.value, done: false }]
      textInput.value = ''
      textInput.focus()
      // initialized with a noop function otherwise the render() below will never "fire"
      // because we are in its dependencies and our dependency `textInput` is
      // assigned inside it.
    })), () => {})

    $.onTodoChange = reduce(({ host, todos }) => (todo => (e => {
      todo.done = e.currentTarget.checked
      $.todos = [mixter.todos]
      if (todo.done) host.dispatch('done', { todo })
    })))

    $.onTodoCleanup = reduce(({ todos }) => (() => {
      $.todos = [mixter.todos.filter(todo => !todo.done)]
    }), () => {})

    effect(({ todos }) => {
      if (todos.length > 0 && todos.filter(todo => !todo.done).length === 0)
        alert('All done! Congrats!')
    })

    render((
      {
        name,
        background,
        doneColor,
        onTodoAdd,
        onTodoChange,
        onTodoCleanup,
        todoColor,
        todos,
      },
    ) => (
      <>
        <style>
          {css`
          width: 250px;
          padding: 10px;
          display: inline-flex;
          flex-flow: column nowrap;
          align-items: center;
          font-family: 'Ubuntu Mono', monospace;
          background: ${background};
          color: ${todoColor};
          .done {
            color: ${doneColor};
          }
          `()}
        </style>

        <h1>{name}</h1>

        <form
          onsubmit={onTodoAdd}
          style={{
            display: 'flex',
            flexFlow: 'column nowrap',
            alignItems: 'center',
          }}
        >
          <div>
            <input ref={ref.textInput} type="text" autofocus />
            <button type="submit">Add</button>
          </div>

          <ol>
            {todos.map(todo => (
              <li class={todo.done ? 'done' : ''}>
                <label>
                  <input
                    type="checkbox"
                    checked={todo.done}
                    onchange={onTodoChange(todo)}
                  />
                  {todo.done
                    ? <strike>{todo.name}</strike>
                    : todo.name}
                </label>
              </li>
            ))}
          </ol>

          {todos.some(todo => todo.done)
            && <button onclick={onTodoCleanup}>Cleanup</button>}
        </form>
      </>
    ))
  })
) {}

customElements.define('todo-app', TodoApp)

const todoApp = new TodoApp()

document.body.appendChild(todoApp)

todoApp.ondone = ({ detail: { todo } }) => {
  console.log('done', todo)
  // change background to a random hue every time we finish a todo
  todoApp.background = `hsl(${Math.random() * 360}, 30%, 20%)`
}
import { App } from './simple'

customElements.define('x-app', App)

const app = new App()
document.body.appendChild(app)

API