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

@euriklis/ds-architect

v0.3.0

Published

`@euriklis/ds-architect` is a modular and extensible library that provides a rich ecosystem for graph and network-based data structures. Designed with both academic rigor and practical application in mind, this library offers powerful graph algorithms and

Readme

@euriklis/ds-architect is a modular and extensible library that provides a rich ecosystem for graph and network-based data structures. Designed with both academic rigor and practical application in mind, this library offers powerful graph algorithms and network functionalities while also including additional data structure components (like AVL trees, BSTs, queues, and heaps) for broader algorithmic programming.

Features

  • Graph Structures

    • Create, update, and remove nodes and edges using a robust, type-safe API.
    • Support for both directed and symmetric (undirected) graphs.
    • Generate adjacency matrices and perform common traversals (BFS, DFS).
  • Create subgraphs and compute unions, differences, or Kronecker products of graphs.

  • Check connectivity, find cycles, detect Hamiltonian cycles, and test bipartiteness.

  • Generate n-dimensional cube graphs.

  • BaseNetwork & Extended Functionality

    • Integrate domain-specific attributes (e.g., model, prompt, callback, modelOptions) into graph nodes.
    • Extend basic graph behavior to support network operations such as centrality measures and neural network concepts.
    • Asynchronous traversal methods (e.g., BFSAsync, DFSAsync) for integrating LLM or other async operations.
  • Compute shortest paths and minimum spanning trees.

  • Additional Data Structures

  • Along with graphs, ds-architect includes other fundamental data structures—like queues, heaps, and trees—to support algorithmic programming.

  • Designed to be lightweight: you can import only what you need without the overhead of heavy mathematics libraries.

Installation

Install via npm:

npm install @euriklis/ds-architect

Or via bun:

bun install @euriklis/ds-architect

Documentation

Sub-library overview

Below is a brief summary of the main modules shipped with this package. Each class has additional examples and details in its corresponding documentation file linked above.

DataNode

  • DataNode<T> – Base class for all nodes. Provides id and data getters and setters along with a constructor that accepts optional data and id.

DoublyLinkedList

  • DoublyLinkedList<T> – A bidirectional list with optional size limit. Common methods include addLast, removeFirst, removeLast, insertBefore, insertAfter, filter, traverse, merge, and iteration with [Symbol.iterator]. Additional helpers provide remove, values, loop, every, any, copy, clean, isSame, and isExactlySame.

Queue

  • Queue<T> – FIFO queue built on a linked list. Supports enqueue, enqueueMany, dequeue, dequeueMany, traverse, filter, merge, [Symbol.iterator], and helpers like contains, reverse, clean, copy, and toArray.

Stack

  • DynamicStack<T> – Resizable LIFO stack with push, pushMany, pop, popMany, filter, traverse, loop, append, popAndTraverse, clear, copy, and iteration.
  • StaticStack<T> – Array-backed variant with similar API for fixed-size use cases and identical helper methods.

BST

  • BST<T> – Binary search tree providing insert, insertMany, delete, deleteNode, binarySearch, BFS, DFS, and iteration support. Additional helpers cover min/max lookups, predecessor/successor queries, height calculation, filter, clean, copy, toArray, print, isSame, isExactlySame, and id-based has.

AVLTree

  • AVLTree<T> – Self-balancing tree that extends BST and rebalances on insert or delete. Includes copy and print utilities, and exposes rotation helpers like singleLeftRotation, singleRightRotation, doubleLeftRightRotation, and doubleRightLeftRotation.

Heap

  • Heap<T> and PrimaryHeap<T> – Binary heap implementations. Key methods are add, search, remove, merge, searchIndex, and static from to build a heap from an array. Further utilities include toArray, iteration via [Symbol.iterator], and configurable size, type and compare properties.

Graph and networks

  • Graph<T> – Generic graph structure with addNode, removeNode, addEdge, removeEdge, data lookups, degree helpers, BFS/DFS traversals (sync or async), and utilities like subgraph, union, difference, kronecker, isConnected, cycles, Hamiltonian, biGraph, and nCube. Additional algorithms include topologicalOrder, bridges, directedBridges, and helpers like clone, upgradeToBaseNetwork and upgradeToGraph.
  • BaseNetwork – Extends Graph so nodes hold numeric values and edges carry weights.
  • StateGraph – Lightweight graph focused on node/edge management without traversal algorithms.

Usage:

Here is a quick look at how to work with the library.

Basic Graph

import { Graph } from "@euriklis/ds-architect";

const g = new Graph<string>();
g.addNode({ name: "A", data: "hello" });
g.addNode({ name: "B", data: "world" });

g.addEdge({ source: "A", target: "B", data: null, params: {} });
console.log(g.inDegree("B")); // 1

Building Your Own Structures

The DataNode class is the foundation for nodes used by the other data structures. You can extend it to craft custom nodes for your own structures and algorithms.

import { DataNode } from "@euriklis/ds-architect";

class MyNode<T> extends DataNode<T> {
  // add extra properties or behavior here
}

const node = new MyNode({ foo: 42 });
console.log(node.id); // auto-generated UUID

Create arrays, lists, or tree-like structures from these nodes to design tailored data structures for your application.