トップに戻る
tags
npm install p-limit
import pLimit from 'p-limit'; const limit = pLimit(4); const tasks = urls.map((url) => limit(async () => { return fetch(url).then((r) => r.json()); }), ); const results = await Promise.all(tasks);
edit