@coffret/queue
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

Queue

Lightweight, type-safe, and memory-efficient queue for resource-sensitive applications.

Install

npm install @coffret/queue

Usage

import { Queue } from '@coffret/queue';

type AwesomeFood = '🍎' | '🌽' | '🥜';

const queue = new Queue<AwesomeFood>();

queue.enqueue('🌽');
queue.enqueue('🥜');

console.log(queue.size);
//=> 2

console.log(...queue);
//=> '🌽 🥜'

console.log(queue.dequeue());
//=> '🌽'

console.log(queue.dequeue());
//=> '🥜'

Package Sidebar

Install

npm i @coffret/queue

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

2.72 kB

Total Files

3

Last publish

Collaborators

  • aadilmehrajbhat