Why easy-stack

Choose it when newer work should win.

easy-stack turns recency into an explicit execution rule. It is a focused LIFO runner—not a general job system—so the behavior stays small enough to understand, inspect, and trust.

A sharp fit for priority work

You needWhat easy-stack gives you
Newest intent firstStrict LIFO selection through ordinary push() and pop() semantics.
Deliberate continuationEach task owns the hand-off and calls this.next() when downstream work may proceed.
Priority discovered during workNew tasks inserted by the active task run before older pending work.
Node and browser deliveryOne native Node module, a modern classic script, and an ES5 browser fallback.
Low operational weightZero runtime dependencies, no build step, and a compact public API.

Confidence comes from evidence

  • One Node implementation: ESM import and CommonJS require() resolve to the same stack.js constructor on Node 22.13 and newer.
  • Native private state: v2.1 removes runtime WeakMap lookups while keeping the live-array, control-field, validation, and error-recovery contracts.
  • Named behavior: 94 non-duplicated Unit, Functional, Behavioral, Integration, and Regression cases explain exactly what is protected.
  • Measured quality: shared Node and Chrome coverage gates require 100% statements, branches, functions, and lines.
  • Reproducible performance: the checked-in benchmark compares the exact 2.0.0 release with the current implementation and validates every timed run.
No “fastest library” claim.

The benchmark measures easy-stack against its own previous release. It demonstrates the value of this implementation change without pretending unrelated packages have equivalent contracts.

Know when to choose something else

Use a FIFO queue when arrival order and fairness matter more than recency. Use a concurrency pool when the main problem is limiting parallel promises. Use a durable broker when work must survive process failure, retry across machines, or be audited as a job record.

Choose easy-stack when execution is in-process, newest-first ordering is intentional, and the active task should decide when control moves on.

Next pageBuild your first stack