A lightweight library for scheduling and throttling large numbers of fetch requests in the browser or Node.js. Version 0.4.0 allows you to limit concurrent fetch requests, queue excess requests, and individually cancel or remove requests. The package ships with ESM and UMD bundles, works with both import and script tag usage, and includes TypeScript definitions. Compared to Promise pools or manual throttling, it provides a dedicated `createFetch` method that returns a cancelable promise and offers built-in statistics. It has a minimal API surface with only one main class, making it easy to integrate into data-heavy applications such as tile map loading or API batch processing.
npm install fetch-schedulerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a FetchScheduler, queuing two concurrent fetch requests, and retrieving scheduler statistics.
Store the promise returned by `createFetch` directly: `const req = scheduler.createFetch(url, opts);` then use `req.cancel();`.
Use: `const fs = window.fs; const scheduler = new fs.FetchScheduler({...});`Explicitly set `requestCount` to a value appropriate for your environment (e.g., 10 for Node.js, 6 for browser).
Do not pass `signal` in fetch options; use the promise's `.cancel()` method instead.
Use named import: `import { FetchScheduler } from 'fetch-scheduler';`Use `const FetchScheduler = window.fs.FetchScheduler;` or `const { FetchScheduler } = window.fs;`Store the promise: `const p = scheduler.createFetch(...); p.cancel();`
No dependency data recorded yet.