Skip to content
Eugene Lazutkin edited this page Jul 30, 2026 · 14 revisions

time-queues

Node.js CI NPM version

Lightweight library for asynchronous task scheduling and concurrency control in JavaScript. Works in browsers, Node.js, Deno, and Bun.

For installation, quick start, and browser notes see the README.

Search

🔍 Search this wiki — ranked, deep-linked search via wiki-search; install the bookmarklet to search in place. Fallback: GitHub wiki search.

Documentation

Queues

  • Scheduler — time-based task scheduling (delays, dates, repeats)
  • IdleQueue — run tasks during browser idle periods
  • FrameQueue — run tasks in animation frames
  • LimitedQueue — concurrency-controlled async queue
  • PageWatcher — react to page lifecycle changes

Utility Functions

  • sleep() — promise-based delay
  • defer() — execute on next tick
  • throttle() — rate-limit a function (first call wins)
  • debounce() — delay until input stabilizes
  • sample() — sample at regular intervals
  • audit() — collect then execute after delay
  • batch() — run async ops with concurrency limit
  • waitFor() — poll a condition until it turns truthy

Supporting Classes

Base Classes

Random Utilities

  • random-dist — random numbers (uniform, normal, exponential, Pareto)
  • random-sleep — randomized delays from various distributions

Page Load Helpers

Cookbook

Release Notes

For Contributors & AI Agents

  • AGENTS.md — project conventions for contributors and AI coding assistants
  • llms.txt — machine-readable project summary
  • llms-full.txt — full API reference for LLMs

Clone this wiki locally