myfetchapi
Advanced tools
Comparing version 1.7.1 to 1.7.2
{ | ||
"name": "myfetchapi", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "mFetch is a JavaScript library that provides a utility function for making HTTP requests with queuing and retry functionality.", | ||
@@ -5,0 +5,0 @@ "type": "commonjs", |
@@ -11,2 +11,4 @@ # myfetchapi | ||
npm install myfetchapi | ||
yarn add myfetchapi | ||
bun add myfetchapi | ||
``` | ||
@@ -26,3 +28,5 @@ | ||
{ method: "GET" }, | ||
{ maxRetry: 5 /* default is 3. To disable retries, set it to `null` or `0` */ } | ||
{ | ||
maxRetry: 5 /* default is 3. To disable retries, set it to `null` or `0` */, | ||
} | ||
) | ||
@@ -43,2 +47,13 @@ .then((response) => console.log(response)) | ||
- `options` (optional): myFetchOptions - Additional options. | ||
- `useNodeFetch` (optional): boolean - Set to true to use Node.js [Options](https://www.npmjs.com/package/node-fetch#fetch-options), e.g., agents. | ||
- `maxRetry` (optional): number | null - How many times a request will retry if it failed. Default is 3. | ||
- `retryCb` (optional): function - Callback function that is called when the HTTP(S) request is retrying. | ||
- Parameters: | ||
- `err`: Error object. | ||
- `count`: Retry count. | ||
- `max`: Max retry count. | ||
- `retryCondition` (optional): function - Function to override and set your own condition for retrying. | ||
- Parameters: | ||
- `res`: HTTP(S) Response object. | ||
- Returns: boolean | Promise<boolean> | ||
- Returns: Promise<Response> | ||
@@ -45,0 +60,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
538960
68