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

0.0.1 • Public • Published

@datastructures/queue ➡️|➡️|

Typed with TypeScript npm version

A minimal functional typed implementation of a queue. 🦄

An ordered structure of data inputs obeying the principle of first in, first out.


Install

yarn add @datastructures/queue -D

Usage

import { queue } from '@datastructures/queue'

const todo = queue()
todo.add('do laundry')
todo.add('wash car')
todo.remove()
todo.print() // => 'wash car'
todo.length() // => 1

API

Methods

add(item) adds an item to the queue

ex: queue.add('foo') remove() removes the last item from the queue ex: queue.remove() length() returns the length of the queue print() prints all items in the queue


Data Structures 🦄

Basic. Functional. Typed. Data Structures.

Functional typed data structures offering structure clarity and simplicity.


View other data structures.

/@datastructures/queue/

    Package Sidebar

    Install

    npm i @datastructures/queue

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    6.81 kB

    Total Files

    9

    Last publish

    Collaborators

    • yowainwright