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

@sarathcani999/mugglekit

v2.1.0

Published

Core utilities and components for the Muggle Kit monorepo

Readme

Muggle Kit

A lightweight, reactive frontend framework for building dynamic web applications with a virtual DOM implementation and event-driven architecture.

Features

Virtual DOM Implementation

The framework implements a virtual DOM system that efficiently manages DOM updates. Instead of directly manipulating the browser's DOM (which can be expensive), changes are first made to a lightweight virtual representation and then efficiently applied to the actual DOM.

  • Virtual Node Types: Supports text nodes, element nodes, and fragments
  • Efficient Rendering: Only updates DOM elements that have changed
  • Clean Lifecycle: Proper mounting and unmounting with resource cleanup

Component-Based Architecture

Build your application through composable, reusable components with a clear separation of concerns:

  • State Management: Maintain application state within component scope
  • View Functions: Declarative UI representation based on state
  • Event Handling: Intuitive event binding and propagation

Reactive Event System

A reactive event dispatcher that enables seamless communication between components:

  • Command Pattern: Dispatch and subscribe to events by name
  • Reducer Pattern: Transform state predictably in response to events
  • Lifecycle Hooks: Execute code at specific points in the application lifecycle

Declarative DOM Creation

Create DOM structures using simple function calls with JSX-like syntax:

  • Element Creation: Create DOM elements with the h() function
  • Fragment Support: Group multiple elements without a wrapper node
  • Text Nodes: Simple text content handling

Attribute and Event Management

Comprehensive management of element attributes and event listeners:

  • Class Handling: Support for both string and array class definitions
  • Style Management: Inline style application with proper typing
  • Event Binding: Clean API for attaching and removing event listeners
  • Data Attributes: Support for custom data attributes

Clean API Surface

A minimal, intuitive API that's easy to learn and apply:

  • Simple App Initialization: Create apps with minimal boilerplate
  • Mount/Unmount: Easy application lifecycle management
  • Typed Interface: TypeScript support for better development experience

Getting Started

Basic Usage

import { createApp, h } from './framework';

// Define initial state
const initialState = { count: 0 };

// Define view function
const view = (state, emit) => h('div', {}, [
  h('h1', {}, [`Count: ${state.count}`]),
  h('button', { 
    on: { 
      click: () => emit('INCREMENT') 
    } 
  }, ['Increment'])
]);

// Define reducers
const reducers = {
  INCREMENT: (state) => ({ ...state, count: state.count + 1 })
};

// Create and mount the app
const app = createApp({
  state: initialState,
  view,
  reducers
});

app.mount(document.getElementById('app'));

Core Components

  • createApp: Main entry point for creating application instances
  • h: Function for creating virtual DOM elements
  • hFragment: Create document fragments for grouped elements
  • Dispatcher: Event system for communication between components
  • mountDOM/destroyDOM: Functions for DOM manipulation

Advanced Features

  • Automatic Cleanup: Event listeners are automatically removed when elements are destroyed
  • Flexible Attribute Handling: Support for complex attribute types
  • Performance Optimized: Minimizes DOM operations for better performance

Note: This Project was created as part of research purpose on breaking down the inner working of a Frontend Framework. It is not intended for production-grade usage.