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

@bigskysoftware/paxi-js

v0.0.1

Published

paxi.js - A Small DOM Morphing Companion for fixi.js

Readme

paxi.js is an experimental, minimalist companion to fixi.js that swaps HTML into the DOM by morphing instead of replacing: preserving existing nodes, focus, scroll position, and form state wherever the old and new trees align.

Part of the fixi project.

When paired with fixi, paxi registers itself as the morph swap strategy, so you can write fx-swap="morph" and get id-keyed reconciliation out of the box. It also works stand-alone via the window.morph(target, html) global.

Here is an example:

<script src="fixi.js"></script>
<script src="paxi.js"></script>

<button fx-action="/profile"
        fx-target="#profile"
        fx-swap="morph">
    Reload Profile
</button>
<div id="profile">
    <input id="nickname" placeholder="typing here survives the swap">
    <p id="bio">...</p>
</div>

The response HTML replaces the contents of #profile, but the <input> keeps its focus, caret, and any in-progress value because its id matches a node in the incoming markup.

Minimalism

paxi is to idiomorph what fixi is to htmx: a smaller, less ambitious take on the same idea. No configuration, no callbacks, no head-merging, no id-set inference - just a single recursive diff that keeps id-keyed nodes stable as the tree around them changes.

As such, it does not include many features found in idiomorph or morphdom:

  • head merging / stylesheet reconciliation
  • beforeNodeMorphed / afterNodeMorphed callbacks
  • outerHTML vs innerHTML modes
  • id-set propagation across ancestors
  • pluggable node matchers

A hard constraint on the project is that the unminified, uncompressed size stays under 2KB.

Installing

Drop paxi.js in a script tag after (or before) fixi.js:

<script src="fixi.js"></script>
<script src="paxi.js"></script>

Or install via npm:

npm install paxi-js

API

window.morph(target, html)

Morph target (an Element) toward the first element parsed from html (a string). The target is updated in place when the root node names match; otherwise it is replaced.

morph(document.getElementById("panel"), "<div id='panel'>new contents</div>")

fx-swap="morph"

When loaded alongside fixi, paxi registers a config hook that intercepts fx-swap="morph" and wires it to morph(cfg.target, cfg.text).

Modus Operandi

paxi walks the old and new trees in lockstep:

  1. If node type or name differ, the old node is replaced - but any id-keyed descendant of the incoming node whose id matches a node in the old tree is first rescued into place.
  2. For text and comment nodes, the value is updated when it differs.
  3. For elements, attributes are synced (extras removed, missing added, values updated).
  4. Children are reconciled positionally, except that id-keyed children in the incoming tree pull their original counterparts forward when they exist.

LICENCE

BSD-0