promise-queue is a tiny library for running arbitrary promise-returning functions in sequence.
npm install --save @tdreyno/promise-queue
import { create } from "@tdreyno/promise-queue"
const q = create()
// Will run these in order of function execution (a, b, c) rather than in parallel.
const results = await Promise.all([
q.enqueue(() => "a"),
q.enqueue(() => "b"),
q.enqueue(() => "c"),
])