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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@uplink-protocol/core

v0.0.11

Published

Odyssey Uplink Protocol - Core package with vanilla JS integration

Readme

Uplink Protocol

A universal frontend protocol for decoupling UI and logic.

PACKAGE STRUCTURE NOTICE:
This package (@uplink-protocol/core) contains only the core functionality of the Uplink Protocol.
Framework-specific adapters are available in separate packages:

  • @uplink-protocol/react - React integration
  • @uplink-protocol/vue - Vue integration
  • @uplink-protocol/angular - Angular integration
  • @uplink-protocol/svelte - Svelte integration

Vanilla JavaScript integration is included in the core package.

Module Format: This package is delivered as ESM (ECMAScript Modules) only.

Introduction

Uplink Protocol is a framework-agnostic approach to frontend development that provides a clean separation between UI components and application logic. It enables you to write business logic once and render it with any UI framework.

Installation

# Install the core package
npm install @uplink-protocol/core

# For React integration
npm install @uplink-protocol/react

Quick Start

Initializing the Adapter

Initialize the appropriate adapter for your framework at your application's entry point:

// For vanilla JavaScript
import { initializeVanillaAdapter } from '@uplink-protocol/core';
initializeVanillaAdapter();

// For React
import { initializeReactAdapter } from '@uplink-protocol/react';
initializeReactAdapter();

Creating a Controller

import { StandardBinding, EventEmitter } from '@uplink-protocol/core';

class CounterController {
  constructor() {
    // Bindings (reactive state)
    this.bindings = {
      count: new StandardBinding(0)
    };
    
    // Methods
    this.methods = {
      increment: () => {
        const newCount = this.bindings.count.current + 1;
        this.bindings.count.set(newCount);
        this.events.increment.emit(newCount);
      },
      
      decrement: () => {
        const newCount = this.bindings.count.current - 1;
        this.bindings.count.set(newCount);
      }
    };
    
    // Events
    this.events = {
      increment: new EventEmitter()
    };
  }
}

Using with Vanilla JavaScript

import { initializeVanillaAdapter, useUplink } from '@uplink-protocol/core';
import { CounterController } from './counter.controller';

// Initialize the adapter
initializeVanillaAdapter();

// Use the controller
const { state, methods, connect } = useUplink(new CounterController());

// Connect to DOM
const counterElement = document.getElementById('counter');
connect(counterElement, {
  onIncrement: (value) => {
    console.log(`Counter: ${value}`);
  }
});

// Set up UI
counterElement.innerHTML = `
  <div>Count: <span id="count">${state.count}</span></div>
  <button id="increment">+</button>
  <button id="decrement">-</button>
`;

// Add event listeners
document.getElementById('increment').addEventListener('click', methods.increment);
document.getElementById('decrement').addEventListener('click', methods.decrement);

// Update UI when state changes
methods.bindings.count.subscribe(value => {
  document.getElementById('count').textContent = value;
});

Using with React

import React from 'react';
import { initializeReactAdapter, useUplink } from '@uplink-protocol/react';
import { CounterController } from './counter.controller';

// Initialize the adapter
initializeReactAdapter();

function Counter() {
  const { state, methods, Container } = useUplink(new CounterController());
  
  return (
    <Container onIncrement={(value) => console.log(`Counter: ${value}`)}>
      <div>Count: {state.count}</div>
      <button onClick={methods.increment}>+</button>
      <button onClick={methods.decrement}>-</button>
    </Container>
  );
}

Documentation

Comprehensive documentation is available in the docs folder:

Core Features

  • Decoupled Logic & UI: Controllers manage state, UI handles rendering
  • Universal Reactivity: Framework-agnostic state updates
  • Logic Portability: Write once, render anywhere approach
  • Framework Adapters: Built-in support for major frameworks
  • TypeScript Support: Comprehensive type definitions
  • Testing-First Design: Easy to test business logic in isolation

License

MIT