New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@utilityjs/queue

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@utilityjs/queue

An implementation of Queue data structure.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

UtilityJS | Queue

A First-In-First-Out (FIFO) queue data structure.

Features

  • FIFO Operations: Enqueue and dequeue elements
  • Peek Support: View front element without removal
  • TypeScript Support: Full generic type safety

Installation

npm install @utilityjs/queue

or

pnpm add @utilityjs/queue

Usage

import { Queue } from "@utilityjs/queue";

const queue = new Queue<number>();

queue.enqueue(1);
queue.enqueue(2);
queue.enqueue(3);

queue.peek(); // 1
queue.dequeue(); // 1
queue.dequeue(); // 2
queue.isEmpty(); // false

API

Queue<T>

Constructor

  • new Queue<T>() - Creates an empty queue

Methods

  • isEmpty(): boolean - Check if the queue is empty
  • enqueue(value: T): void - Add element to the rear
  • dequeue(): T | null - Remove and return the front element
  • peek(): T | null - View the front element without removing

Contributing

Read the contributing guide to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.

License

This project is licensed under the terms of the MIT license.

Keywords

javascript

FAQs

Package last updated on 09 Feb 2026

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