fetch-defaults

JSON →
library 1.0.0 ·javascript
verified Jun 7, 2026

Functional and immutable mixin for the Fetch API that sets a default base URL and/or default options (e.g., headers) on fetch calls. Version 1.0.0 is stable and follows semantic versioning. It does not modify input objects and supports both browser and Node.js environments when paired with a polyfill like node-fetch or fetch-off. Its key differentiator is immutability: options are merged recursively without mutation, and it does not pollute prototypes.