Javis OS
Javis OS is an Agentic AI that assists entrepreneurs in business tasks, helping them grow their work.
AI translation
QuokkaQuery is a small software studio making software for making software — focused tools for the designing and shaping that happens before anything ships.
BusinessTypeScriptGitHub @NodlumeOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Generic reusable graph library with structure representation and traversal methods
Taken from the repository README
Loading the full README.
Read the full README ↗Built and maintained by QuokkaQuery. Source on GitHub.
Generic TypeScript graph library with adjacency-list representation. Supports directed and undirected graphs, weighted edges, traversals, and common graph algorithms.
npm install @quokkaquery/graph
import { Graph } from "@quokkaquery/graph";
const g = new Graph<string>({ directed: true });
g.addNode("a", "Alice")
.addNode("b", "Bob")
.addNode("c", "Carol");
g.addEdge("a", "b", 1);
g.addEdge("b", "c", 2);
g.addEdge("a", "c", 10);
// Shortest path
const result = g.dijkstra("a", "c");
// { distance: 3, path: ["a", "b", "c"] }
new Graph<T, E>(opts?: { directed?: boolean })
T — node data type (default unknown)E — edge data type (default unknown)directed — defaults to true| Method | Returns | Description |
|---|---|---|
addNode(id, data) | this | Add a node (chainable) |
getNode(id) | GraphNode<T> | undefined | Get node by id |
hasNode(id) | boolean | Check if node exists |
removeNode(id) | boolean | Remove node and all its edges |
nodeCount | number | Number of nodes |
nodeIds() | NodeId[] | All node ids |
nodeEntries() | GraphNode<T>[] | All nodes |
| Method | Returns | Description |
|---|---|---|
addEdge(from, to, weight?, data?) | this | Add an edge (chainable, default weight 1) |
getEdge(from, to) | Edge<E> | undefined | Get edge between two nodes |
hasEdge(from, to) | boolean | Check if edge exists |
removeEdge(from, to) | boolean | Remove an edge |
edgeCount | number | Number of edges |
edges() | Edge<E>[] | All edges (deduplicated for undirected) |
| Method | Returns | Description |
|---|---|---|
neighbors(id) | NodeId[] | Outgoing neighbor ids |
outEdges(id) | Edge<E>[] | Outgoing edges |
inEdges(id) | Edge<E>[] | Incoming edges |
outDegree(id) | number | Number of outgoing edges |
inDegree(id) | number | Number of incoming edges |
degree(id) | number | Total degree |
predecessors(id) | NodeId[] | Nodes with edges pointing to this node |
successors(id) | NodeId[] | Nodes this node points to |
connectedNodes(id) | NodeId[] | Union of predecessors and successors |
| Method | Returns | Description |
|---|---|---|
isSource(id) | boolean | In-degree 0 (directed only) |
isSink(id) | boolean | Out-degree 0 (directed only) |
isIsolated(id) | boolean | Degree 0 |
sources() | NodeId[] | All source nodes |
sinks() | NodeId[] | All sink nodes |
isolatedNodes() | NodeId[] | All isolated nodes |
| Method | Returns | Description |
|---|---|---|
reachableFrom(id) | Set<NodeId> | All nodes reachable via outgoing edges |
reachableTo(id) | Set<NodeId> | All nodes that can reach this node |
| Method | Description |
|---|---|
bfs(start, visitor) | Breadth-first traversal. Return false from visitor to stop early. |
dfs(start, visitor) | Depth-first traversal. Return false from visitor to stop early. |
findBfs(start, predicate) | Find first node matching predicate via BFS |
findDfs(start, predicate) | Find first node matching predicate via DFS |
| Method | Description |
|---|---|
topologicalSort() | Kahn's algorithm. Throws if graph has a cycle. Directed only. |
hasCycle() | Cycle detection (DFS for directed, Union-Find for undirected) |
dijkstra(start, end) | Shortest path. Returns { distance, path } or undefined. |
connectedComponents() | Connected (undirected) or weakly-connected (directed) components |
| Method | Description |
|---|---|
mapNodes(fn) | Transform node data, producing a new graph |
subgraph(ids) | Extract a subgraph containing only the given node ids |
type NodeId = string | number;
interface GraphNode<T> { id: NodeId; data: T }
interface Edge<E> { from: NodeId; to: NodeId; weight: number; data: E }
type Visitor<T> = (node: GraphNode<T>, depth: number) => void | false;
type NodePredicate<T> = (node: GraphNode<T>) => boolean;
npm test # run tests
npm run test:watch # watch mode
npm run build # compile TypeScript
undefined data. If you need typed data, call addNode first.edges() deduplicates but outEdges()/inEdges() do not."Graph contains a cycle" — catch it or check hasCycle() first.const deps = new Graph<string>();
deps.addEdge("build", "lint");
deps.addEdge("test", "build");
const order = deps.topologicalSort(); // ["test", "build", "lint"]
const g = new Graph<string>();
g.addEdge("a", "b", 4).addEdge("b", "c", 2).addEdge("a", "c", 7);
const result = g.dijkstra("a", "c"); // { distance: 6, path: ["a", "b", "c"] }
const important = new Set(g.nodeIds().filter(id => g.degree(id) > 3));
const sub = g.subgraph(important);
MIT © QuokkaQuery
Part of the open-source tooling behind QuokkaQuery.