Bun workspace for all ResQ packages published to npm under the @resq-sw scope.
| Package | Description | Version |
|---|---|---|
@resq-sw/ui |
React component library (Radix + Tailwind) | |
@resq-sw/dsa |
Data structures and algorithms (zero deps) |
Production-grade data structures and algorithms with zero runtime dependencies. TypeScript-first with full type exports.
npm install @resq-sw/dsa
# or
bun add @resq-sw/dsaProbabilistic set membership testing with configurable false-positive rate.
import { BloomFilter } from "@resq-sw/dsa";
const filter = new BloomFilter({ expectedItems: 1000, falsePositiveRate: 0.01 });
filter.add("drone-001");
filter.has("drone-001"); // true
filter.has("drone-999"); // false (probably)Frequency estimation for streaming data with bounded error.
import { CountMinSketch } from "@resq-sw/dsa";
const sketch = new CountMinSketch({ width: 1024, depth: 5 });
sketch.add("event-type-A");
sketch.add("event-type-A");
sketch.estimate("event-type-A"); // >= 2Weighted directed/undirected graph with pathfinding algorithms.
import { Graph } from "@resq-sw/dsa";
const graph = new Graph<string>({ directed: true });
graph.addVertex("A");
graph.addVertex("B");
graph.addVertex("C");
graph.addEdge("A", "B", 1);
graph.addEdge("B", "C", 2);
graph.bfs("A"); // breadth-first traversal
graph.dijkstra("A", "C"); // shortest path (Dijkstra)
graph.aStar("A", "C", heuristic); // shortest path (A*)Fixed-capacity min/max heap for top-K selection.
import { BoundedHeap } from "@resq-sw/dsa";
const heap = new BoundedHeap<{ id: string; score: number }>({
capacity: 10,
compare: (a, b) => a.score - b.score,
});
heap.push({ id: "item-1", score: 0.95 });
heap.peek(); // highest-scored itemPrefix tree for autocomplete and string search.
import { Trie, rabinKarp } from "@resq-sw/dsa";
const trie = new Trie();
trie.insert("rescue");
trie.insert("respond");
trie.search("res"); // ["rescue", "respond"]
// Rabin-Karp string matching
const matches = rabinKarp("hello world hello", "hello");Advanced pattern matching with statistics.
import { RabinKarp, quickSearch } from "@resq-sw/dsa";
const rk = new RabinKarp({ pattern: "drone" });
const results = rk.searchAll("drone alpha drone beta");
// Quick single-pattern search
const found = quickSearch("payload data payload", "payload");Configurable priority queue with factory helpers.
import {
PriorityQueue,
createMinHeap,
createDeadlineQueue,
createPriorityLevelQueue,
} from "@resq-sw/dsa";
// Min-heap by numeric value
const minHeap = createMinHeap<number>();
minHeap.enqueue(5);
minHeap.enqueue(1);
minHeap.dequeue(); // 1
// Deadline-based queue (earliest deadline first)
const deadlines = createDeadlineQueue();
deadlines.enqueue({ id: "task-1", deadline: Date.now() + 5000, priority: 1 });
// Priority level queue
const levels = createPriorityLevelQueue();
levels.enqueue({ id: "critical", priority: 0 });
levels.enqueue({ id: "normal", priority: 5 });Distance calculations across multiple formulas: geospatial, mathematical, and set-based.
import { Distance } from "@resq-sw/dsa";
// Haversine (great-circle distance)
const nyc = { lat: 40.7128, lng: -74.006 };
const london = { lat: 51.5074, lng: -0.1278 };
Distance.haversine(nyc, london); // ~5570 km
// Euclidean
Distance.euclidean({ lat: 0, lng: 0 }, { lat: 3, lng: 4 }); // 5
// Cosine similarity distance
Distance.cosine({ lat: 1, lng: 0 }, { lat: 0, lng: 1 }); // 1 (orthogonal)
// Jaccard set dissimilarity
Distance.jaccard(new Set([1, 2, 3]), new Set([2, 3, 4])); // 0.5
// 3D with altitude
Distance.threed(
{ lat: 40.7128, lng: -74.006, alt: 100 },
{ lat: 51.5074, lng: -0.1278, alt: 200 },
);
// Generic calculate method
Distance.calculate("vincenty", nyc, london);
Distance.calculate("manhattan", nyc, london);
Distance.calculate("chebyshev", nyc, london);
Distance.calculate("hamming", nyc, london);
Distance.calculate("sorensen-dice", new Set([1, 2]), new Set([2, 3]));Supported formulas: euclidean, haversine, vincenty, manhattan, chebyshev, minkowski, threed, cosine, hamming, jaccard, sorensen-dice.
For runtime validation using Effect, import from the /schemas subpath. Effect is an optional peer dependency and not required for core usage.
import { /* schema exports */ } from "@resq-sw/dsa/schemas";A production-ready React component library built with Radix UI primitives, Tailwind CSS v4, and strict TypeScript safety. Dark-first design with oklch color system, tree-shakeable subpath exports, and WCAG 2.1 AA accessibility.
See the full documentation in packages/ui/README.md.
bun add @resq-sw/ui react react-dom tailwindcssimport "@resq-sw/ui/styles/globals.css";
import { Button } from "@resq-sw/ui/button";
import { Card } from "@resq-sw/ui/card";
export const App = () => (
<Card>
<Button onClick={() => alert("Ready!")}>Click Me</Button>
</Card>
);- Bun >= 1.x
- Node.js >= 20.19.0
git clone https://github.com/resq-software/npm.git
cd npm
bun installbun install # Install all workspace dependencies
bun test # Run all workspace tests
bun --filter @resq-sw/dsa test # Test DSA package only
bun --filter @resq-sw/ui test # Test UI package only
bun --filter @resq-sw/ui build # Build UI package
bun --filter @resq-sw/dsa build # Build DSA packageEach package has its own scripts. Navigate to the package directory or use bun --filter:
# UI: Start Storybook
bun --filter @resq-sw/ui storybook
# UI: Lint with Biome
bun --filter @resq-sw/ui lint
# DSA: Type-check
bun --filter @resq-sw/dsa build- Commit Convention: Follow Conventional Commits.
- Quality Standards: All code must pass linting, type-checking, and tests before submission.
- Branching: Branch from
mainand submit a Pull Request. - Testing: Run
bun testfrom the workspace root before finalizing.
See CONTRIBUTING.md and DEVELOPMENT.md for full details.
This project is licensed under the Apache-2.0 License. See LICENSE.md for details.
Copyright 2026 ResQ Software