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

@phillipsharring/graspr-framework

v0.2.5

Published

HTMX + Handlebars + Tailwind frontend framework

Readme

Graspr Framework

A frontend framework for building server-driven web applications with HTMX + Handlebars + Tailwind CSS.

Graspr handles the hard parts of HTMX-based apps: boosted navigation, auth-gated widgets, modal/toast systems, CSRF token management, form error handling, and client-side template rendering — so you can focus on your pages and domain logic.

Installation

npm install @phillipsharring/graspr-framework

Peer dependencies (your app must install these):

npm install htmx.org handlebars sortablejs

For a ready-to-go project structure, use the Graspr App Skeleton.

What's Included

Core Infrastructure (core/)

  • boosted-nav — fixes HTMX boosted navigation edge cases (inherited targets, hx-select overrides, layout mismatch detection)
  • csrf — global fetch() interceptor + HTMX hook for automatic CSRF token headers
  • auth-state — auth-gated UI orchestration (auth-load events, permission gating, login modal, 401/403 handling)
  • forms — inline form error display, modal form lifecycle, success redirect/refresh patterns
  • pagination — paginated table controls with URL param syncing
  • search — debounced search input with HTMX integration
  • sortable — drag-and-drop reordering via SortableJS wrapper
  • table-sort — clickable column header sorting with URL persistence
  • navigation — URL helpers, active nav highlighting

UI Widgets (ui/)

  • modal — global modal state machine with focus management and overlay/escape handling
  • modal-form — modal form populator (set fields, method, clear errors, focus)
  • toast — toast notification system with auto-dismiss
  • confirm-dialog — confirmation dialog with optional progress mode for batch operations
  • typeahead — autocomplete widget factory with keyboard navigation
  • click-burst — visual click feedback animation

HTMX Extensions (lib/)

  • json-enc — JSON encoding extension for HTMX requests
  • client-side-templates — Handlebars template rendering for HTMX JSON responses

Helpers (helpers/)

  • handlebars-helpers — generic Handlebars helpers (eq, neq, and, or, truncate, timeAgo, formatDateTime, json, treeIndent, etc.)
  • escape-html — HTML escape utility
  • populate-select<select> field populator
  • route-params — URL parameter extraction for dynamic routes ([id] patterns)
  • debounce — debounce utility + search input sanitization

Auth (auth.js)

  • Single /api/auth/me call per page load, cached
  • checkAuth() — returns Promise<boolean>
  • getAuthData() — returns full auth response with permissions
  • refreshAuthData() — invalidates cache and re-fetches

API Client (fetch-client.js)

  • apiFetch(url, options) — wraps fetch() with CSRF headers, JSON content type, body serialization

Styles (styles/base.css)

  • Form error styles, HTMX request dimming, modal/takeover animations, sortable drag-and-drop, table sort headers, confirm dialog, active nav highlighting

Usage

Import everything at once

import {
    GrasprToast, openFormModal, GrasprConfirm,
    initPagination, initTableSort,
    getRouteParams, escapeHtml,
} from '@phillipsharring/graspr-framework';

Side-effect initialization

// Registers CSRF interceptors, boosted-nav handlers, auth-state listeners,
// form error handling, search, and sortable — in the correct order.
import '@phillipsharring/graspr-framework/init';

HTMX extensions (import after setting window.Handlebars)

import '@phillipsharring/graspr-framework/src/lib/json-enc.js';
import '@phillipsharring/graspr-framework/src/lib/client-side-templates.js';

Styles

@import 'tailwindcss';
@source "../../content/**/*.html";
@source "../**/*.js";
@import '@phillipsharring/graspr-framework/styles/base.css';

Configurable auth permissions

import { registerAdminPermissionPrefixes } from '@phillipsharring/graspr-framework';

registerAdminPermissionPrefixes([
    ['/admin/design/', 'design.access'],
    ['/admin/story/', 'story.access'],
    ['/admin/', 'admin.access'],
]);

Designed For

Graspr is the frontend companion to Handlr Framework (PHP backend), but works with any backend that serves JSON APIs and HTML pages. The auth system expects a /api/auth/me endpoint; everything else is configurable.

Requirements

  • Vite 7+
  • Tailwind CSS 4+
  • Node.js 18+

License

MIT