Skip to content

Commit 2b1366f

Browse files
committed
docs: Update README to reflect improved code coverage and add new features comparison with SWR
1 parent 6ded07e commit 2b1366f

File tree

1 file changed

+41
-33
lines changed

1 file changed

+41
-33
lines changed

README.md

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[npm-url]: https://npmjs.org/package/fetchff
1010
[npm-image]: https://img.shields.io/npm/v/fetchff.svg
1111

12-
[![NPM version][npm-image]][npm-url] [![Blazing Fast](https://badgen.now.sh/badge/speed/blazing%20%F0%9F%94%A5/green)](https://github.com/MattCCC/fetchff) [![Code Coverage](https://img.shields.io/badge/coverage-96.97-green)](https://github.com/MattCCC/fetchff) [![npm downloads](https://img.shields.io/npm/dm/fetchff.svg?color=lightblue)](http://npm-stat.com/charts.html?package=fetchff) [![gzip size](https://img.shields.io/bundlephobia/minzip/fetchff)](https://bundlephobia.com/result?p=fetchff) [![snyk](https://snyk.io/test/github/MattCCC/fetchff/badge.svg)](https://security.snyk.io/package/npm/fetchff)
12+
[![NPM version][npm-image]][npm-url] [![Blazing Fast](https://badgen.now.sh/badge/speed/blazing%20%F0%9F%94%A5/green)](https://github.com/MattCCC/fetchff) [![Code Coverage](https://img.shields.io/badge/coverage-97.13-green)](https://github.com/MattCCC/fetchff) [![npm downloads](https://img.shields.io/npm/dm/fetchff.svg?color=lightblue)](http://npm-stat.com/charts.html?package=fetchff) [![gzip size](https://img.shields.io/bundlephobia/minzip/fetchff)](https://bundlephobia.com/result?p=fetchff) [![snyk](https://snyk.io/test/github/MattCCC/fetchff/badge.svg)](https://security.snyk.io/package/npm/fetchff)
1313

1414
</div>
1515

@@ -1496,38 +1496,46 @@ function UserComponent({ userId }: { userId: string }) {
14961496
14971497
## Comparison with other libraries
14981498
1499-
| Feature | fetchff | ofetch | wretch | axios | native fetch() |
1500-
| -------------------------------------------------- | ----------- | ----------- | ------------ | ------------ | -------------- |
1501-
| **Unified API Client** | ✅ | -- | -- | -- | -- |
1502-
| **Smart Request Cache** | ✅ | -- | -- | -- | -- |
1503-
| **Automatic Request Deduplication** | ✅ | -- | -- | -- | -- |
1504-
| **Revalidation on Window Focus** | ✅ | -- | -- | -- | -- |
1505-
| **Custom Fetching Adapter** | ✅ | -- | -- | -- | -- |
1506-
| **Built-in Error Handling** | ✅ | -- | ✅ | -- | -- |
1507-
| **Customizable Error Handling** | ✅ | -- | ✅ | ✅ | -- |
1508-
| **Retries with exponential backoff** | ✅ | -- | -- | -- | -- |
1509-
| **Advanced Query Params handling** | ✅ | -- | -- | -- | -- |
1510-
| **Custom Retry logic** | ✅ | ✅ | ✅ | -- | -- |
1511-
| **Easy Timeouts** | ✅ | ✅ | ✅ | ✅ | -- |
1512-
| **Polling Functionality** | ✅ | -- | -- | -- | -- |
1513-
| **Easy Cancellation of stale (previous) requests** | ✅ | -- | -- | -- | -- |
1514-
| **Default Responses** | ✅ | -- | -- | -- | -- |
1515-
| **Custom adapters (fetchers)** | ✅ | -- | -- | ✅ | -- |
1516-
| **Global Configuration** | ✅ | -- | ✅ | ✅ | -- |
1517-
| **TypeScript Support** | ✅ | ✅ | ✅ | ✅ | ✅ |
1518-
| **Built-in AbortController Support** | ✅ | -- | -- | -- | -- |
1519-
| **Request Interceptors** | ✅ | ✅ | ✅ | ✅ | -- |
1520-
| **Request and Response Transformation** | ✅ | ✅ | ✅ | ✅ | -- |
1521-
| **Integration with libraries** | ✅ | ✅ | ✅ | ✅ | -- |
1522-
| **Request Queuing** | ✅ | -- | -- | -- | -- |
1523-
| **Multiple Fetching Strategies** | ✅ | -- | -- | -- | -- |
1524-
| **Dynamic URLs** | ✅ | -- | ✅ | -- | -- |
1525-
| **Automatic Retry on Failure** | ✅ | ✅ | -- | ✅ | -- |
1526-
| **Automatically handle 429 Retry-After headers** | ✅ | -- | -- | -- | -- |
1527-
| **Built-in Input Sanitization** | ✅ | -- | -- | -- | -- |
1528-
| **Prototype Pollution Protection** | ✅ | -- | -- | -- | -- |
1529-
| **Server-Side Rendering (SSR) Support** | ✅ | ✅ | -- | -- | -- |
1530-
| **Minimal Installation Size** | 🟢 (4.5 KB) | 🟡 (6.5 KB) | 🟢 (2.21 KB) | 🔴 (13.7 KB) | 🟢 (0 KB) |
1499+
_fetchff uniquely combines advanced input sanitization, prototype pollution protection, unified cache across React and direct fetches, multiple error handling strategies, and a declarative API repository pattern—all in a single lightweight package._
1500+
1501+
| Feature | fetchff | ofetch | wretch | axios | native fetch() | swr |
1502+
| -------------------------------------------------- | ----------- | ----------- | ------------ | ------------ | -------------- | ----------- |
1503+
| **Unified API Client** | ✅ | -- | -- | -- | -- | -- |
1504+
| **Smart Request Cache** | ✅ | -- | -- | -- | -- | ✅ |
1505+
| **Automatic Request Deduplication** | ✅ | -- | -- | -- | -- | ✅ |
1506+
| **Revalidation on Window Focus** | ✅ | -- | -- | -- | -- | ✅ |
1507+
| **Custom Fetching Adapter** | ✅ | -- | -- | -- | -- | ✅ |
1508+
| **Built-in Error Handling** | ✅ | -- | ✅ | -- | -- | -- |
1509+
| **Customizable Error Handling** | ✅ | -- | ✅ | ✅ | -- | ✅ |
1510+
| **Retries with exponential backoff** | ✅ | -- | -- | -- | -- | -- |
1511+
| **Advanced Query Params handling** | ✅ | -- | -- | -- | -- | -- |
1512+
| **Custom Response Based Retry logic** | ✅ | ✅ | ✅ | -- | -- | -- |
1513+
| **Easy Timeouts** | ✅ | ✅ | ✅ | ✅ | -- | -- |
1514+
| **Conditional Polling Functionality** | ✅ | -- | -- | -- | -- | -- |
1515+
| **Easy Cancellation of stale (previous) requests** | ✅ | -- | -- | -- | -- | -- |
1516+
| **Default Responses** | ✅ | -- | -- | -- | -- | ✅ |
1517+
| **Custom adapters (fetchers)** | ✅ | -- | -- | ✅ | -- | ✅ |
1518+
| **Global Configuration** | ✅ | -- | ✅ | ✅ | -- | ✅ |
1519+
| **TypeScript Support** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
1520+
| **Built-in AbortController Support** | ✅ | -- | -- | -- | -- | -- |
1521+
| **Request Interceptors** | ✅ | ✅ | ✅ | ✅ | -- | -- |
1522+
| **Safe deduping + cancellation** | ✅ | -- | -- | -- | -- | -- |
1523+
| **Response-based polling decisions** | ✅ | -- | -- | -- | -- | -- |
1524+
| **Request and Response Transformation** | ✅ | ✅ | ✅ | ✅ | -- | -- |
1525+
| **Integration with libraries** | ✅ | ✅ | ✅ | ✅ | -- | ✅ |
1526+
| **Request Queuing** | ✅ | -- | -- | -- | -- | -- |
1527+
| **Multiple Fetching Strategies** | ✅ | -- | -- | -- | -- | -- |
1528+
| **Dynamic URLs with Path and query separation** | ✅ | -- | ✅ | -- | -- | -- |
1529+
| **Automatic Retry on Failure** | ✅ | ✅ | -- | ✅ | -- | ✅ |
1530+
| **Automatically handle 429 Retry-After headers** | ✅ | -- | -- | -- | -- | -- |
1531+
| **Built-in Input Sanitization** | ✅ | -- | -- | -- | -- | -- |
1532+
| **Prototype Pollution Protection** | ✅ | -- | -- | -- | -- | -- |
1533+
| **First Class React Integration** | ✅ | -- | -- | -- | -- | ✅ |
1534+
| **Shared cache for React and direct fetches** | ✅ | -- | -- | -- | -- | -- |
1535+
| **Per-endpoint and per-request config merging** | ✅ | -- | -- | -- | -- | -- |
1536+
| **Declarative API repository pattern** | ✅ | -- | -- | -- | -- | -- |
1537+
| **Supports Server-Side Rendering (SSR)** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
1538+
| **Minimal Installation Size** | 🟢 (4.5 KB) | 🟡 (6.5 KB) | 🟢 (2.21 KB) | 🔴 (13.7 KB) | 🟢 (0 KB) | 🟡 (6.2 KB) |
15311539
15321540
## ✏️ Examples
15331541

0 commit comments

Comments
 (0)