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

1.0.0 • Public • Published

amaui logo

amaui Queue

Queue


MIT license     Production ready     UMD 1.5kb gzipped     100% test cov     Browser and Nodejs

Very simple code     Modern code     Junior friendly     Typescript     Made with 💛


Getting started

Add

  // yarn
  yarn add @amaui/queue

  // npm
  npm install @amaui/queue

Use cases

  • First come, first serve, use cases
  • CPU Scheduling
  • Memory management
  • Website requests handling on the server
  • Routers and switches in networking
  • etc.

Use

  import AmauiQueue from '@amaui/queue';

  // Make a new queue instance
  const amauiQueue = new AmauiQueue();

  // Add values
  amauiQueue.push(1, 2, 3, 4);

  amauiQueue.first;
  // 1

  amauiQueue.length;
  // 4

  const value = amauiQueue.pop();

  value;
  // 1

  amauiQueue.first;
  // 2

  amauiQueue.length;
  // 3

Dev

Install

  yarn

Test

  yarn test

Prod

Build

  yarn build

Docs

Might be soon...

Package Sidebar

Install

npm i @amaui/queue

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

20.6 kB

Total Files

11

Last publish

Collaborators

  • lazareric