A lightweight AJAX component wrapper around the Fetch API, providing a simplified interface for HTTP requests with caching, request/response interceptors, and centralized error handling. Current stable version is 1.2.0. Released as needed with no regular cadence. Key differentiators: ESM-only import style, support for common methods (get, post, put, patch, del), and a configurable response handler for centralized error processing. Less mature than alternatives like axios or ky, minimal documentation.
npm install fetch-requestNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the instance with global settings and performs a simple GET request.
Set content-type header in config or per-request options: headers: { 'Content-Type': 'application/json' }Use import syntax instead of require().
Ensure backend returns { errorCode, data, errorMessage } or override respHandle to match your API.Change 'import fetchRequest from 'fetch-request'' to 'import { get, post, setConfig } from 'fetch-request''Replace require('fetch-request') with import { ... } from 'fetch-request'No dependency data recorded yet.