A minimal Node.js task queue for executing asynchronous functions sequentially. Version 1.1.4. It ensures that tasks are processed one after another in order, returning a promise that resolves when all tasks complete. Suitable for use with generators and promises. No external dependencies. Supports Node.js >=6.
npm install sg-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This shows how to create a queue, push tasks, and wait for completion.
Design your application to handle queued tasks as fire-and-forget or use a library that supports cancellation.
Capture results by appending .then() to the return of queue.push(), as shown in the usage example.
For modern Node.js (>=14), consider using a more actively maintained queue library like 'p-queue' or 'async.queue'.
If you need concurrency, choose a dedicated async task queue like 'p-queue' (supports concurrency limit).
Remove 'new'; just call sgQueue() as a normal function.
Run 'npm install sg-queue --save' in your project root.
Ensure you require the function and call it to create a queue object. queue.push is available before queue.then() resolves.
No dependency data recorded yet.