Skip to content

Universal React-style hooks for fetch() — works in Node, Bun, Deno, Cloudflare Workers, and edge runtimes. Tiny, dependency-free, TypeScript-first.

License

Notifications You must be signed in to change notification settings

felaur/fetch-hooks-core

Repository files navigation

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

npm install fetch-hooks-core

🧭 Quick Example

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)

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/felaur/fetch-hooks-core
npm: https://npmjs.com/package/fetch-hooks-core

About

Universal React-style hooks for fetch() — works in Node, Bun, Deno, Cloudflare Workers, and edge runtimes. Tiny, dependency-free, TypeScript-first.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published