https://github.com/devforgetech/fetch-hooks-core
Universal React-style hooks for fetch() — works in Node, Bun, Deno, Cloudflare Workers, and edge runtimes. Tiny, dependency-free, TypeScript-first.
https://github.com/devforgetech/fetch-hooks-core
bun cloudflare-workers deno edge-runtime fetch hooks http javascript nodejs npm-library opensource request signals typescript
Last synced: 5 months ago
JSON representation
Universal React-style hooks for fetch() — works in Node, Bun, Deno, Cloudflare Workers, and edge runtimes. Tiny, dependency-free, TypeScript-first.
- Host: GitHub
- URL: https://github.com/devforgetech/fetch-hooks-core
- Owner: devforgetech
- License: mit
- Created: 2025-11-21T09:27:30.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-11-21T11:09:57.000Z (5 months ago)
- Last Synced: 2025-11-21T11:23:11.487Z (5 months ago)
- Topics: bun, cloudflare-workers, deno, edge-runtime, fetch, hooks, http, javascript, nodejs, npm-library, opensource, request, signals, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/fetch-hooks-core
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fetch-hooks-core
The Modern Fetch Utility Library for JavaScript — Tiny, Typed, Universal
Designed for developers building Node servers, Bun scripts,
Deno apps, Cloudflare Workers, and Edge runtimes.
---
# 🚀 Introduction
`fetch-hooks-core` brings the ergonomics of React hooks to any JavaScript environment — no framework required.
If you use `fetch()` often, this library gives you **reactive data**, **retry logic**, **polling**, and **concurrency tools** that feel instantly familiar.
### SEO Keywords:
fetch hooks, TypeScript fetch library, universal fetch utilities, Node fetch wrapper, Bun fetch, Deno fetch, fetch concurrency, fetch retry
---
# ✨ Feature Matrix
| Feature | fetch-hooks-core | Ky | Axios |
| ------------------------------ | ---------------- | ---------- | --------- |
| Universal runtime support | ✅ | ❌ | ❌ |
| Hook-style API | ✅ | ❌ | ❌ |
| Zero dependencies | ✅ | ❌ | ❌ |
| Concurrency control | ✅ | ❌ | ❌ |
| Polling helper | ✅ | ❌ | ❌ |
| Retry with exponential backoff | ✅ | ⚠️ limited | ⚠️ plugin |
| TypeScript-first | ✅ | ⚠️ | ⚠️ |
---
# 📦 Installation
```bash
npm install fetch-hooks-core
```
---
# 🧭 Quick Example
```ts
import { useFetch } from 'fetch-hooks-core';
const { data, loading, error } = await useFetch('https://example.com');
```
---
# 🧠 API Documentation
## useFetch()
Reactive data wrapper for fetch.
## useRetry()
Retries any async function automatically.
## usePoll()
Polling with auto-stop.
## useConcurrent()
Parallel queue processor.
---
# 🛠️ Advanced Example (Premium)
```ts
import { useFetch, useRetry, useConcurrent } from 'fetch-hooks-core';
const api = await useFetch('https://api.example.com/data');
const retryFetch = useRetry(() => fetch('https://api.com/retry'), { retries: 5 });
const { results } = await useConcurrent([() => fetch('/a'), () => fetch('/b')], { concurrency: 2 });
```
---
# ❤️ Community
If you find this useful, star the repo and share it.
# 📎 Links
GitHub: https://github.com/devforgetech/fetch-hooks-core
npm: https://npmjs.com/package/fetch-hooks-core