FIFO task queue for Node.js and browser that executes asynchronous tasks in strict order. Version 1.2.1 is stable, with infrequent updates. Supports promises, timeouts, and task cancellation via CancellationToken. Differentiators include simple API, cancellation of queued/active tasks, and error handling that continues execution. Ships TypeScript types.
npm install sequential-task-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a FIFO queue and push two synchronous tasks that log in order.
Always attach a .catch() handler to the promise returned by push() to handle cancellation rejections.
Be aware that timeout applies only to the execution duration; queue wait time is not counted.
Listen to the 'error' event: queue.on('error', (err) => console.error(err));Use queue.push(task, { timeout: 1000 }) instead of queue.push(task, 1000).Use `import { SequentialTaskQueue } from 'sequential-task-queue'` instead of `const SequentialTaskQueue = require('sequential-task-queue')`.Attach a .catch() to the push() promise, or use the 'error' event on the queue.
No dependency data recorded yet.