Registry / testing / fetch-multiple

fetch-multiple

JSON →
library1.2.3jsnpmunverified

A lightweight utility (v1.2.3) for fetching multiple resources in a single Promise. Works with any fetch-compatible client, returns parsed responses keyed by URL. Last updated 2016; low activity. Key differentiator: simple API over ad-hoc Promise.all patterns.

npm install fetch-multiple
INSTALL
IMPORT
SIG · FETCH-MULTIPLE
F
fetch-multiple
testingjavascriptv1.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import fetchMultiple from 'fetch-multiple'
✗ import { fetchMultiple } from 'fetch-multiple'
Default export only; named import will fail.
default
✓ const fetchMultiple = require('fetch-multiple')
✗ const { fetchMultiple } = require('fetch-multiple')
CJS require returns the function directly.
default
✓ import fetchMultiple from 'fetch-multiple'
✗ import { default as fetchMultiple } from 'fetch-multiple'
Unnecessary; default import works directly.

Demonstrates basic usage: fetch two endpoints with different parse methods.

import fetchMultiple from 'fetch-multiple'; const fetchables = { 'https://api.example.com/users': 'json', 'https://api.example.com/text': 'text' }; fetchMultiple(fetchables) .then(data => { console.log(data); }) .catch(err => console.error(err));
Debug
Known issues
gotchaThe library returns a plain object, not a Map. Keys are the URL strings exactly as provided.
fix
Access results with bracket notation using the original URL string.
affects: >=1.0.0
breakingIn future releases, the returned object keys may change from URL strings to paths or hashes.
fix
Do not rely on key format; check documentation before upgrading.
affects: >=1.0.0
deprecatedThe library is no longer actively maintained; use Promise.all() with fetch() instead.
fix
Replace with native Promise.all or a modern alternative like p-map.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: fetchMultiple is not a function
CommonJS require with destructuring: const { fetchMultiple } = require('fetch-multiple')
fix
Use const fetchMultiple = require('fetch-multiple') without destructuring.
SyntaxError: Unexpected token import
Using ES import syntax in a CommonJS environment without transpilation
fix
Use require() in Node.js or configure Babel/webpack for ES modules.
Uncaught (in promise) TypeError: Failed to fetch
One or more URLs are invalid or CORS blocked
fix
Ensure all URLs are correct and server allows cross-origin requests.
Upgrade
Version history
1.2.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
fetch-multiple — npm install fetch-multiple · libregistry