{"id":49456,"library":"stubborn-fetch","title":"Stubborn Fetch","description":"A lightweight fetch wrapper that adds configurable retry logic to HTTP requests. Version 0.2.8 is the latest stable release, with no regular release cadence. It supports exponential backoff, customizable retry conditions based on status codes or network failures, and global error limits. Unlike more opinionated libraries like axios-retry, stubborn-fetch offers fine-grained control over retry timing and per-request options while remaining minimal in size.","status":"active","version":"0.2.8","language":"javascript","source_language":"en","source_url":"https://github.com/Quiq/stubborn-fetch","tags":["javascript","fetch","retry"],"install":[{"cmd":"npm install stubborn-fetch","lang":"bash","label":"npm"},{"cmd":"yarn add stubborn-fetch","lang":"bash","label":"yarn"},{"cmd":"pnpm add stubborn-fetch","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package exports a default class; CommonJS require works but is non-standard","wrong":"const StubbornFetch = require('stubborn-fetch')","symbol":"StubbornFetch","correct":"import StubbornFetch from 'stubborn-fetch'"},{"note":"Named export for the request class; also exported as default","wrong":"","symbol":"StubbornFetchRequest","correct":"import { StubbornFetchRequest } from 'stubborn-fetch'"},{"note":"Error class used for retry callbacks","wrong":"","symbol":"StubbornFetchError","correct":"import { StubbornFetchError } from 'stubborn-fetch'"}],"quickstart":{"code":"import StubbornFetch, { StubbornFetchRequest } from 'stubborn-fetch';\nconst request = new StubbornFetchRequest('https://api.example.com/data', {\n  method: 'GET'\n}, {\n  retries: 3,\n  timingFunction: 'exponential',\n  maxDelay: 30000,\n  minimumStatusCodeForRetry: 500,\n  retryOnNetworkFailure: true\n});\nrequest.send().then(response => {\n  console.log('Success:', response);\n}).catch(error => {\n  console.error('Failed:', error);\n});","lang":"javascript","description":"Configures a GET request with 3 retries on server errors or network failures using exponential backoff."},"warnings":[{"fix":"Set minimumStatusCodeForRetry to 500 or implement shouldRetry to exclude certain status codes.","message":"Minimum status code for retry includes both server errors and client errors by default (400). This may cause unintended retries on 4xx responses.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Set retryOnNetworkFailure: true in options.","message":"Retry on network failure is disabled by default. Network errors will reject the promise without retry.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Only 'exponential' and 'linear' are supported; custom timing requires implementing your own retry logic.","message":"Timing function is a string that maps to predefined functions; custom functions are not supported via string.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.2.8':16 'add':8 'axio':51 'axios-retri':50 'backoff':30 'base':34 'cadenc':26 'code':37 'condit':33 'configur':9 'control':60 'customiz':31 'error':43 'exponenti':29 'failur':40 'fetch':2,5,55,75 'fine':58 'fine-grain':57 'global':42 'grain':59 'http':13 'javascript':74 'latest':19 'librari':48 'lightweight':4 'like':49 'limit':44 'logic':11 'minim':71 'network':39 'offer':56 'opinion':47 'option':68 'per':66 'per-request':65 'regular':24 'releas':21,25 'remain':70 'request':14,67 'retri':10,32,52,62,76 'size':73 'stabl':20 'status':36 'stubborn':1,54 'stubborn-fetch':53 'support':28 'time':63 'unlik':45 'version':15 'wrapper':6","created_at":"2026-06-07T17:01:52.490188+00:00","updated_at":"2026-06-07T17:01:52.490188+00:00","problems":[{"fix":"Use import { StubbornFetchRequest } from 'stubborn-fetch' instead of import StubbornFetchRequest from ...","cause":"Using default import but StubbornFetchRequest is a named export.","error":"TypeError: StubbornFetchRequest is not a constructor"},{"fix":"Use 'exponential' or 'linear' for timingFunction.","cause":"Passing an unsupported timing function string.","error":"Error: timingFunction must be one of: exponential, linear"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Quiq/stubborn-fetch#readme","github":"https://github.com/Quiq/stubborn-fetch","docs":null,"changelog":null,"pypi":null,"npm":"stubborn-fetch","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}