
Security News
Frontier AI Is Now Critical Infrastructure
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.
@hyperfrontend/list-utils
Advanced tools
Purpose-built collection utilities for queue management, filtering, and iteration patterns.
Purpose-built collection utilities for queue management, filtering, and iteration patterns.
@hyperfrontend/list-utils provides specialized collection utilities focused on common programming patterns that native JavaScript arrays don't handle elegantly. Rather than replicating lodash, this library targets specific use cases: FIFO/LIFO queue management with object reference tracking, cyclical value iteration, and string array sanitization.
The library enforces immutability through frozen interfaces while maintaining high performance. All queue operations (FIFO/LIFO) use native Set for O(1) lookups and guaranteed uniqueness, solving the common problem of accidentally adding duplicate items to task queues or event handlers.
Queue implementations return frozen objects to prevent external mutation while using native Set internally for optimal performance. Object-only restriction on queues prevents reference comparison issues with primitives.
Native arrays don't enforce uniqueness, making it easy to accidentally register the same event handler, task, or subscription multiple times. FIFO/LIFO lists automatically reject duplicates based on reference equality, eliminating a common source of memory leaks and duplicate processing in event loops, job queues, and observer patterns.
The value picker solves the boilerplate problem of cycling through options (load balancer endpoints, color schemes, retry strategies). No manual index tracking or modulo math—just call next(). Particularly useful for testing scenarios where you need predictable value rotation.
nonEmptyStrings() and uniqueStrings() handle the tedious work of cleaning user input, configuration arrays, or CSV parsing results. Filters null/undefined/empty/whitespace-only values in one call, with full TypeScript type narrowing.
All utilities return new arrays or frozen objects, never mutate inputs. This makes them safe for use in React hooks dependencies, Redux reducers, or any pure function context. No lodash required for these specific operations.
npm install @hyperfrontend/list-utils
import { createFifoList, createValuePicker, nonEmptyStrings, uniqueStrings } from '@hyperfrontend/list-utils'
// FIFO queue for task management
const taskQueue = createFifoList<{ id: string; execute: () => void }>()
taskQueue.push({ id: 'task1', execute: () => console.log('Task 1') })
taskQueue.push({ id: 'task2', execute: () => console.log('Task 2') })
const nextTask = taskQueue.pull() // Gets task1 (first in)
// Round-robin value picker
const colorPicker = createValuePicker(['red', 'blue', 'green'])
colorPicker.next() // 'red'
colorPicker.next() // 'blue'
colorPicker.next() // 'green'
colorPicker.next() // 'red' (cycles back)
// String sanitization
const userInputs = [' hello ', '', 'world', null, 'hello', ' ', 'world']
const cleaned = uniqueStrings(nonEmptyStrings(userInputs)) // ['hello', 'world']
createFifoList<T>() - First-in-first-out queue with reference uniquenesscreateLifoList<T>() - Last-in-first-out stack with reference uniquenesscreateValuePicker(values) - Cyclical iterator for round-robin patternscreateRange(start, end) - Generate number arrays without loopsnonEmptyStrings(values) - Filter null/undefined/empty/whitespace stringsuniqueStrings(values) - Remove duplicates while preserving ordergetLastKeyInMap(map) - Retrieve the last inserted key from a Map| Platform | Support |
|---|---|
| Browser | ✅ |
| Node.js | ✅ |
| Web Workers | ✅ |
| Deno, Bun, Cloudflare Workers | ✅ |
| Format | File | Tree-Shakeable |
|---|---|---|
| ESM | index.esm.js | ✅ |
| CJS | index.cjs.js | ❌ |
| IIFE | bundle/index.iife.min.js | ❌ |
| UMD | bundle/index.umd.min.js | ❌ |
Bundle size: 1 KB (minified, self-contained)
<!-- unpkg -->
<script src="https://unpkg.com/@hyperfrontend/list-utils"></script>
<!-- jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/@hyperfrontend/list-utils"></script>
<script>
const { createQueue, forEach } = HyperfrontendListUtils
</script>
Global variable: HyperfrontendListUtils
| Package | Type |
|---|---|
| @hyperfrontend/data-utils | Internal |
This library is part of the hyperfrontend monorepo. Full documentation.
MIT
FAQs
Purpose-built collection utilities for queue management, filtering, and iteration patterns.
The npm package @hyperfrontend/list-utils receives a total of 128 weekly downloads. As such, @hyperfrontend/list-utils popularity was classified as not popular.
We found that @hyperfrontend/list-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.