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

@eldrex/cairn

v1.0.0

Published

Framework-agnostic, reactive web components with zero dependencies.

Readme

Cairn — Framework-Agnostic UI Component Builder

Build reactive, framework-agnostic web components with zero external dependencies. Use with React, Vue, Svelte, Angular, or vanilla HTML.

npm License: MIT LLM Prompt Context

🤖 Prompting AI Assistants? Copy-paste llms.txt or CAIRN_AI_PROMPT.md into ChatGPT, Claude, or Gemini for 100% accurate Cairn code generation.


Why Cairn?

Cairn provides plain functions, standard HTML element builders, fine-grained reactivity, zero-traffic WASM performance, zero abstraction walls, and an extensible plugin system. No custom template syntax. No compiler locking you in.

import { state, button, div, mount } from '@eldrex/cairn';

let count = state(0);

let app = div(
    button(
        () => `Clicked ${count.value} times`,
        { onclick: () => count.value++ }
    )
);

mount("#app", app);

🔑 Key Architecture

1. Extensibility & Middleware System

Plugins are simple functions receiving Cairn context. Middleware allows intercepting element creation, mounting, state mutations, and style updates.

import { cairn, tailwind } from '@eldrex/cairn';

// Use Tailwind CSS Adapter
cairn.use(tailwind);

// Global Middleware Interceptor
cairn.middleware.add({
    afterStateChange(key, oldVal, newVal) {
        console.log(`[State Change] ${oldVal} → ${newVal}`);
    }
});

2. Zero-Traffic WASM Engine (wasmEngine)

State signals reside in shared memory (SharedStateBuffer), enabling WASM updates to mutate DOM nodes via direct pointers (DomRef) with zero boundary crossing traffic.

import { SharedStateBuffer, wasmEngine, DomRef } from '@eldrex/cairn';

const buffer = new SharedStateBuffer(1000);
wasmEngine.batchUpdate(new Float32Array([10, 20, 30]), buffer);

3. Escape Hatches & Unlimited Access

Access native DOM methods, parse raw HTML markup, instantiate Web Components, or configure global engines:

import { raw, element, canvas, config } from '@eldrex/cairn';

const rawNodes = raw('<div class="card">Raw HTML</div>');
const customComp = element('my-web-component', { prop: 'value' });
const canvasEl = canvas({ width: 800, height: 600 });

4. Framework Bridges (React, Vue, Angular, Svelte)

Mount Cairn components anywhere or convert them directly into framework wrappers:

import { cairnToReact, cairnToVue, cairnToSvelte } from '@eldrex/cairn';

const ReactComponent = cairnToReact(MyCairnComponent);
const VueComponent = cairnToVue(MyCairnComponent);

⚡ CLI Tooling (@eldrex/cairn-cli)

# Scaffold component or library
npx cairn create my-component

# Start HTTP dev server with SSE live reload
npx cairn dev

# Generate standalone documentation site in docs/
npx cairn docs

# Analyze production bundle file sizes
npx cairn analyze

Project Structure

cairn/
├── src/
│   ├── state.js          // Reactive signals engine (state, computed, effect, collection, resource)
│   ├── dom.js            // HTML tag builders & escape hatches (h, div, button, raw, element, canvas)
│   ├── extensibility.js  // Plugin loader, middleware interceptors & deep configuration
│   ├── framework-bridges.js // React, Vue, Angular, Svelte adapters
│   ├── wasm.js           // WASM Engine & SharedStateBuffer zero-traffic layer
│   ├── virtual-list.js   // 100k+ item high-performance VirtualList
│   ├── mobile.js         // Touch gestures & BottomSheet physics
│   ├── three.js          // WebGL 3D component layer
│   ├── docs.js           // Documentation generator
│   ├── iteration.js      // Hot reload & performance budget monitoring
│   ├── adapters/         // Multi-styling adapters (Tailwind, Tokens)
│   └── ui/               // 50+ pre-built UI primitives
├── bin/cairn.js          // Scaffolding & Development CLI
├── cairn-explorer.js     // Interactive Component Explorer drawer
├── dist/                 // UMD & ESM production bundles
├── docs/                 // Interactive documentation app & guides
├── README.md
└── package.json

Documentation


License

MIT © Eldrex Bula & Cairn Contributors.