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

zylix

v0.7.0

Published

Cross-platform UI framework with Zig core and JavaScript/WebAssembly bridge

Readme

Zylix

Cross-platform UI framework with a Zig core and JavaScript/WebAssembly bridge.

Features

  • Zero-copy state management - All state lives in WASM for performance
  • Virtual DOM - Efficient DOM diffing and patching
  • Component system - Build UIs with composable components
  • TodoMVC ready - Complete todo app implementation included
  • TypeScript support - Full type definitions included

Installation

npm install zylix

Quick Start

import { init, state, todo } from 'zylix';

// Initialize WASM module
await init('node_modules/zylix/wasm/zylix.wasm');

// Use state management
state.increment();
console.log(state.getCounter()); // 1

// Use todo API
todo.init();
const id = todo.add('Learn Zylix');
console.log(todo.getCount()); // 1

Modules

Core (zylix/core)

Foundation module for WASM loading and memory management.

import { init, deinit, isInitialized, getMemoryUsed } from 'zylix';

await init('zylix.wasm');
console.log(isInitialized()); // true
console.log(getMemoryUsed()); // Memory usage in bytes

State (zylix/state)

Application state management with events.

import { state } from 'zylix';

// Dispatch events
state.dispatch(state.Events.INCREMENT);

// Convenience methods
state.increment();
state.decrement();
state.reset();

// Get state
console.log(state.getCounter());
console.log(state.getStateVersion());

// Reactive stores
const store = state.createStore({ count: 0 });
const unsubscribe = store.subscribe(value => console.log(value));
store.set({ count: 1 });
unsubscribe();

Todo (zylix/todo)

Complete TodoMVC implementation.

import { todo } from 'zylix';

// Initialize
todo.init();

// CRUD operations
const id = todo.add('Buy groceries');
todo.toggle(id);
todo.updateText(id, 'Buy organic groceries');
todo.remove(id);

// Bulk operations
todo.toggleAll();
todo.clearCompleted();

// Filtering
todo.setFilter(todo.Filter.ACTIVE);
todo.setFilter(todo.Filter.COMPLETED);
todo.setFilter(todo.Filter.ALL);

// Queries
console.log(todo.getCount());
console.log(todo.getActiveCount());
console.log(todo.getCompletedCount());

// Get items
const items = todo.getVisibleItems();
// [{ id: 1, text: 'Learn Zylix', completed: false }]

VDOM (zylix/vdom)

Virtual DOM for efficient UI updates.

import { vdom } from 'zylix';

// Initialize
vdom.init();

// Create nodes
const div = vdom.createElement(vdom.Tag.DIV);
vdom.setClass(div, 'container');

const text = vdom.createText('Hello, Zylix!');
vdom.addChild(div, text);

// Set as root and commit
vdom.setRoot(div);
const patchCount = vdom.commit();

// Apply patches to DOM
const container = document.getElementById('app');
vdom.applyPatches(container);

Component (zylix/component)

Component-based UI building.

import { component } from 'zylix';

// Initialize
component.init();

// Create components
const container = component.createContainer();
const heading = component.createHeading(1, 'Welcome');
const button = component.createButton('Click me');

// Build tree
component.addChild(container, heading);
component.addChild(container, button);

// Add event handlers
component.onClick(button, 1001); // Callback ID

// Render
component.render(container);

Browser Usage

<script type="module">
import { init, state } from './node_modules/zylix/src/index.js';

await init('./node_modules/zylix/wasm/zylix.wasm');

document.getElementById('increment').onclick = () => {
    state.increment();
    document.getElementById('count').textContent = state.getCounter();
};
</script>

Building WASM

If you need to rebuild the WASM module:

# Requires Zig 0.15.0 or later
cd packages/zylix
npm run prepare:wasm

TypeScript

Full TypeScript definitions are included:

import { init, state, todo, vdom, component } from 'zylix';

await init('zylix.wasm');

// All APIs are fully typed
const items: todo.TodoItem[] = todo.getVisibleItems();

API Reference

Core Functions

| Function | Description | |----------|-------------| | init(wasmSource, options?) | Initialize WASM module | | deinit() | Shutdown WASM module | | isInitialized() | Check initialization status | | getMemoryUsed() | Get memory usage in bytes | | getMemoryPeak() | Get peak memory usage | | getAbiVersion() | Get ABI version number |

State Functions

| Function | Description | |----------|-------------| | dispatch(eventType, payload?) | Dispatch event to core | | getCounter() | Get counter value | | getStateVersion() | Get state version | | increment() | Increment counter | | decrement() | Decrement counter | | reset() | Reset counter | | createStore(initialValue) | Create reactive store |

Todo Functions

| Function | Description | |----------|-------------| | init() | Initialize todo state | | add(text) | Add todo item | | remove(id) | Remove todo item | | toggle(id) | Toggle completion | | toggleAll() | Toggle all items | | clearCompleted() | Clear completed items | | setFilter(filter) | Set filter mode | | getFilter() | Get current filter | | getCount() | Get total count | | getActiveCount() | Get active count | | getCompletedCount() | Get completed count | | getVisibleItems() | Get filtered items | | getAllItems() | Get all items |

Architecture

JavaScript (UI/Events)
        ↓
    zylix.js (Bridge)
        ↓
    zylix.wasm (Zig Core)
        ↓
JavaScript (DOM Updates)

All state management and business logic runs in WASM. JavaScript handles:

  • Loading the WASM module
  • String encoding/decoding
  • DOM manipulation
  • Event binding

Requirements

  • Modern browser with WebAssembly support
  • Node.js 16+ (for build tools)
  • Zig 0.15.0+ (for rebuilding WASM)

License

MIT