nocake
nocake is a JavaScript collections library including Stack, Queue, PriorityQueue, PromiseQueue and LinkedList data structures.
Examples
; let s = ;s;s;s; //=> 2 let q = ;q;q;q; //=> 1 let pq = PriorityQueue;// enqueue(element[, priority])pq;pq;pq;pq; //=> {element: 3, priority: 3}pq; //=> {element: 2, priority: 2} const promisequeue = PromiseQueue; const asyncTask = { return { }}; promisequeue; promisequeue; promisequeue; // async task 1000 Done// async task 3000 Done// async task 2000/4000 Done
Installation
npm install --save nocake
Usage
You can import one or multiple collections from nocake
:
;// orconst Stack Queue PriorityQueue PromiseQueue LinkedList DoublyLinkedList CircularLinkedList = ;