Registry / testing / fetch-min

fetch-min

JSON →
library1.0.0jsnpmunverified

Minified fork of whatwg-fetch providing a polyfill for the Fetch API in browsers that don't support it natively. Version 1.0.0 mirrors whatwg-fetch functionality but reduces file size. Releases are infrequent and tied to whatwg-fetch versions. Differentiator: smaller bundle footprint vs the upstream polyfill. Not recommended for new projects; use native fetch or more actively maintained polyfills.

npm install fetch-min
INSTALL
IMPORT
SIG · FETCH-MIN
F
fetch-min
testingjavascriptv1.0.0
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.

fetch
import 'fetch-min'
const fetch = require('fetch-min')
This polyfill adds fetch to global scope on import. No named export.
Headers
import 'fetch-min'
import { Headers } from 'fetch-min'
Headers is a global after side-effect import.
Request
import 'fetch-min'
import { Request } from 'fetch-min'
Request is added to global scope.
Response
import 'fetch-min'
import { Response } from 'fetch-min'
Response is added to global scope.

Shows how to import the polyfill and use the global fetch function to make a GET request and handle the response.

import 'fetch-min'; fetch('https://example.com/api/data') .then(response => { if (!response.ok) throw new Error('Network response was not ok'); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error('Fetch error:', error));
Debug
Known issues
gotchaThe package name is 'fetch-min' but the import is side-effect only; no named exports exist.
fix
Use import 'fetch-min' and rely on global fetch, Headers, Request, Response.
affects: >=1.0.0
deprecatedThe package replicates whatwg-fetch which is in maintenance mode. Consider using native fetch or a modern polyfill like cross-fetch.
fix
Use native fetch where available or switch to cross-fetch.
affects: >=1.0.0
gotchaThe minified file may be obfuscated, making debugging harder in development.
fix
Use the unminified whatwg-fetch directly for development.
affects: >=1.0.0
Errors
Common errors & fixes
Uncaught TypeError: Failed to fetch
The polyfill is not imported before fetch is called, or the environment lacks fetch support and the polyfill is not loaded.
fix
Ensure 'fetch-min' is imported at the entry point of your application (e.g., import 'fetch-min';).
fetch is not defined
The import is not executed (e.g., tree-shaken) or the polyfill is not loaded.
fix
Import the polyfill as a side effect: import 'fetch-min'; at the top of your app.
Cannot find module 'fetch-min'
Package not installed or not in node_modules.
fix
Run npm install fetch-min or yarn add fetch-min.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
fetch-min — npm install fetch-min · libregistry