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

alpinejs-app

v1.5.1

Published

Simple SPA plugin for Alpinejs

Readme

alpinejs-app

A Simplest Single Page Application (SPA) library for Alpine.js.

The Vision

  • To maintain a clear separation between HTML and JavaScript logic.

    This separation keeps presentation distinct from logic as much as possible and have as few abstractions as possible.

    Develop layout with HTML/CSS and the logic with Alpine.js for two-way data bindings and reactivity.

  • To have some kind of central registry of HTML templates and Javascript classes and use it to register components.

    The registry is just 2 properties in the global app object, app.templates and app.components.

    Server-side rendering of templates (similar to htmx) is supported out of the box, same directives render bundled or remote HTML templates the same way without any external dependencies.

    How the registry is delivered to the browser depends on bundling or application, for example:

    Native support:

    • esbuild: bundle everything into a single file by importing multiple JS/HTML files: see scripts/build-app.js for a simple esbuild plugin
    • server-side: maintain HTML files on the server to load individually on demand using the same directives, see examples/dashboard.html.

    More ideas:

    • keep HTML templates in JSON files to load separately via fetch on demand or via importmap
    • include your .js files in the HTML for small apps and let the browser to handle caching

Features

  • Components: These are the primary building blocks of the UI. They can be either standalone HTML templates or HTML backed by JavaScript classes, capable of nesting other components.

  • Main Component: Displays the current main page within the #app-main HTML element. It manages the navigation and saves the view to the browser history using app.savePath.

  • History Navigation: Supports browser back/forward navigation by rendering the appropriate component on window popstate events, achieved using app.restorePath.

  • Direct Deep-Linking: For direct access, server-side routes must redirect to the main app HTML page, with the base path set as '/app/' by default.

Getting started

Visit the tutorial.

Full documentation

Visit the documentation.

Live demo

Available at demo.

External rendering is not working due pages only serving static content, local demo shows server-side rendering.

Author

Vlad Seryakov

License

Licensed under MIT