Registry / devops / fetch-plus-plus

fetch-plus-plus

JSON →
library1.0.0jsnpmunverified

Fetch wrapper adding retries, error handling, and query string building. v1.0.0 (stable). Isomorphic: works in Node ≥16 and browsers via isomorphic-fetch. Differentiators: built-in retry logic, automatic query string construction from objects, and insecure request support for self-signed certificates. Ships TypeScript types. No release cadence documented.

npm install fetch-plus-plus
INSTALL
IMPORT
SIG · FETCH-PLUS-PLUS
F
fetch-plus-plus
devopsjavascriptv1.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.

default
import fetch from 'fetch-plus-plus'
const fetch = require('fetch-plus-plus').default
ESM default export – use default import in ESM; CommonJS requires .default access.
fetch
import { default as fetch } from 'fetch-plus-plus'
import { fetch } from 'fetch-plus-plus'
Package's main export is the default, not named. Use default import or rename.
type FetchOptions
import type { FetchOptions } from 'fetch-plus-plus'
TypeScript type import for the options parameter.

Shows default ESM usage with POST request, query string, retries, and TypeScript types.

import fetch from 'fetch-plus-plus'; async function main() { const response = await fetch('https://httpbin.org/post', { method: 'POST', headers: { 'Content-Type': 'application/json' }, queryString: { api: 'test' }, retries: 2, insecure: false, body: JSON.stringify({ key: 'value' }) }); console.log(response); } main().catch(err => console.error(err));
Debug
Known issues
gotchaDefault export is a wrapper, not the native fetch API – do not expect standard fetch properties like Response class.
fix
Use the returned value as-is; for low-level control, use node-fetch or global fetch directly.
affects: >=1.0.0
deprecatedinsecure option encourages self-signed certificate bypass; security risk in production.
fix
Avoid insecure: true; use proper certificate validation.
affects: >=1.0.0
gotchaqueryString appends parameters with '?' even if URL already has query – may break existing query strings.
fix
Ensure URL has no query string before using queryString option.
affects: >=1.0.0
gotcharetries count includes the original attempt? No – retries are additional attempts after failure.
fix
Set retries: 3 for up to 3 retries (4 total attempts including initial).
affects: >=1.0.0
Errors
Common errors & fixes
Error: fetch is not a function
Incorrect import – using named import instead of default.
fix
import fetch from 'fetch-plus-plus' (ESM) or const fetch = require('fetch-plus-plus').default (CJS)
TypeError: Failed to fetch
Network error or invalid URL; CORS in browser.
fix
Check URL and network; for self-signed certs ensure insecure: true (not recommended for production).
Cannot find module 'isomorphic-fetch'
Missing or wrong version of isomorphic-fetch dependency.
fix
npm install isomorphic-fetch (v3+). Note: v3 uses ESM.
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Response is not JSON – fetch-plus-plus always parses response as JSON.
fix
Set Content-Type or manually handle non-JSON responses via raw response object (if exposed).
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
isomorphic-fetchrequiredPolyfills the Fetch API for Node.js and older environments
Agent activity
2 hits · last 30 days
node
2
Resources
fetch-plus-plus — npm install fetch-plus-plus · libregistry