Socket
Book a DemoInstallSign in
Socket

@datastructures/queue

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datastructures/queue

A minimal functional typed implementation of Linked List ➡️|➡️|

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

@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.

Keywords

Queue

FAQs

Package last updated on 02 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts