A sharp fit for priority work
| You need | What easy-stack gives you |
|---|---|
| Newest intent first | Strict LIFO selection through ordinary push() and pop() semantics. |
| Deliberate continuation | Each task owns the hand-off and calls this.next() when downstream work may proceed. |
| Priority discovered during work | New tasks inserted by the active task run before older pending work. |
| Node and browser delivery | One native Node module, a modern classic script, and an ES5 browser fallback. |
| Low operational weight | Zero runtime dependencies, no build step, and a compact public API. |
Confidence comes from evidence
- One Node implementation: ESM
importand CommonJSrequire()resolve to the samestack.jsconstructor 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.
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 →