@msnkr/data-structures
v1.4.1
Published
A comprehensive collection of generic data structure implementations for TypeScript/JavaScript, published on npm.
Maintainers
Readme
data-structures
A comprehensive collection of type-safe, zero-dependency data structure implementations for TypeScript/JavaScript.
📚 Full Documentation
Visit our comprehensive documentation site for detailed guides, API references, and examples.
Quick Start
Installation
npm:
npm install @msnkr/data-structuresDeno (JSR):
import { Queue, LRUCache } from 'jsr:@mskr/data-structures';Example
import { Queue, LRUCache } from '@msnkr/data-structures';
// FIFO Queue
const queue = new Queue<number>();
queue.enqueue(1);
queue.enqueue(2);
console.log(queue.dequeue()); // 1
// LRU Cache
const cache = new LRUCache<string, number>({ capacity: 100 });
cache.put('key', 42);
console.log(cache.get('key')); // 42Data Structures
- Queues: Queue, Deque, PriorityQueue
- Lists: LinkedList, DoublyLinkedList
- Heaps: BinaryHeap (MinHeap, MaxHeap)
- Trees: Trie, RedBlackTree
- Maps & Caches: SortedMap, BiDirectionalMap, LRUCache
Features
- 🎯 Type Safety - Full TypeScript support with generics
- 📦 Zero Dependencies - Lightweight and secure
- ⚡ Performance - Optimized implementations with documented time complexities
- 🧪 Well Tested - Comprehensive test coverage (>85%)
- 🌲 Tree Shakeable - Import only what you need
- 🔄 Dual Published - Available on both JSR and npm
Links
- 📚 Documentation - Complete guides and API reference
- 🐛 Issues - Report bugs or request features
- 💬 Discussions - Join the community
License
MIT License - feel free to use this in your own projects!
