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

meta-bridge-graph

v1.0.5

Published

A comprehensive Meta Bridge Graph solution for seamless data connectivity across Frontend and Backend.

Readme

🕸️ Meta Bridge Graph

Version License TypeScript

Meta Bridge Graph (MBG) is a high-performance, developer-first graph management library. It is designed to bridge the gap between complex metadata structures and practical implementation across Frontend and Backend environments.


📖 Table of Contents

  1. Core Concepts
  2. Advanced Features
  3. Installation
  4. API Reference
  5. Advanced Usage Patterns
  6. Multi-Language Support

🧠 Core Concepts

MBG is built on a "Hybrid Architecture" consisting of three layers:

  • Core: Pure logic for graph manipulation, cycle detection, and events. Environment agnostic.
  • Backend: Specialized for Node.js. Includes File System (FS) persistence and DB sync tools.
  • Frontend: Optimized for Browsers. Includes Canvas rendering and reactive search.

🌟 Advanced Features

1. Type-Safe Generics

Define your own metadata structures for nodes and edges to get 100% IntelliSense support.

2. Async Middleware System

Transform or validate data before it hits the graph state. Perfect for automated timestamping or schema validation.

3. Pub/Sub Event System

React to any changes in your graph. Integrate with UI frameworks or logging systems effortlessly.

4. Cycle Detection (DAG Check)

Prevent infinite loops by detecting circular dependencies using an optimized DFS algorithm.


🚀 Installation

npm install meta-bridge-graph

🛠 API Reference

Core Engine

The heart of MBG. Works everywhere.

import { MetaBridgeGraph } from 'meta-bridge-graph';

interface MyNode { name: string }
interface MyEdge { weight: number }

const mbg = new MetaBridgeGraph<MyNode, MyEdge>();

// Middleware
mbg.useNodeMiddleware(async (node) => {
  return { ...node, tags: ['verified'] };
});

// Event Listener
mbg.on(event => {
  if (event.type === 'NODE_ADDED') console.log('New Node:', event.payload.id);
});

await mbg.addNode({ id: '1', metadata: { name: 'Root' } });

Backend Module (Node.js)

import { MBGBackend } from 'meta-bridge-graph/backend';

const serverMbg = new MBGBackend();
await serverMbg.loadFromFile('./data.json');
const stats = serverMbg.getStats();
console.log(`Nodes: ${stats.nodeCount}`);

Frontend Module (Browser)

import { MBGFrontend } from 'meta-bridge-graph/frontend';

const clientMbg = new MBGFrontend();
clientMbg.initCanvas('my-viewport');
clientMbg.render({ animate: true });

💡 Advanced Usage Patterns

Detecting Cycles

mbg.addEdge({ from: '1', to: '2', relation: 'child' });
mbg.addEdge({ from: '2', to: '1', relation: 'loop' });

if (mbg.hasCycle()) {
  throw new Error("Recursive loops are not allowed in this graph!");
}

Deep Cloning for "What-if" Analysis

const experimentalGraph = mbg.clone();
experimentalGraph.removeNode('critical-node');
// Original graph remains untouched!

🌍 Multi-Language Support

👤 Author

ZertCihuy

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.