FIFO · explicit hand-off · zero build

Order work.
Release it precisely.

js-queue runs one function at a time and waits for that function to release the next. It stays small because your task—not the library—knows when the work is actually complete.

  • native ESM
  • CommonJS compatible
  • classic browser build
An ordered row of cyan tasks moves toward one active amber task in a FIFO scheduler

Small by design

One explicit contract.

Add functions in order. The queue starts when idle. Each function receives the queue as this and calls this.next() when it is ready to release the following item.

1tiny runtime dependency, for the optional stack entry
3loading styles: ESM, CommonJS, classic script
100%native V8 coverage gates on the queue core
16focused documentation pages
task 1
task 2
task 3
active
Tasks can release synchronously or later.

Call this.next() inline, in a callback, after a timer, or from finally. Until then, the remaining queue stays ordered and still.