Back to Explore

sindresorhus/yocto-queue

GitHub
2 watchersOpen source

Last release:

yocto-queue is a small JavaScript queue data structure for npm. It’s useful when you need FIFO enqueue and dequeue operations without the performance cost of using Array#shift on large arrays, offering constant-time dequeue behavior. It provides an API like enqueue, dequeue, peek, drain, clear, and exposes the queue as an iterable.

Project status

  • The source is likely not actively maintained as of today, with the last recorded upstream push and latest update on 2025-11-11, about 7 months ago, after a prior update gap of about 8 months.
  • Update cadence appears intermittent rather than steady, with updates in March 2025 (v1.2.0 and v1.2.1) followed by another update in November 2025 (v1.2.2).

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v1.2.2

    yocto-queue v1.2.2 includes a small fix to ensure internal tail state is properly cleaned up when the queue becomes empty. This prevents stale tail references after removing the last element.

  • v1.2.1

    v1.2.1 updates `Queue#drain()` so it no longer ignores queued `undefined` values. Instead of using `undefined` as a sentinel to stop draining, it drains until the queue is actually empty.

    Breaking
  • v1.2.0

    Release v1.2.0 introduces a new `.drain()` method on `Queue` that returns an iterator which dequeues items as they are consumed. Documentation and tests were updated accordingly, and the TypeScript definitions now include the new method.

    Features
  • v1.1.1

    v1.1.1 is a small maintenance release intended to improve compatibility with older Node.js versions (notably Node.js 12). The code change centers on updating the Queue.peek() implementation to avoid syntax not supported by Node.js 12.

  • v1.1.0

    v1.1.0 adds a new `.peek()` method to `yocto-queue`, allowing callers to read the next queued value without removing it. The code diff also includes a few repository and packaging metadata changes that are not mentioned in the release notes.

    SecurityFeatures
  • v1.0.0

    v1.0.0 is a major release that moves yocto-queue to an ESM-only package format and raises the minimum supported Node.js version. The code changes also include a refactor of the queue internals and updates to TypeScript typings and test/usage imports.

    Breaking
  • v0.1.0

    Release v0.1.0 was published on 2020-11-24. The provided release notes contain no actionable information about features, fixes, security changes, or breaking changes.