Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
qfetch/qfetchCore framework for composable fetch middlewares.
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
100%
Published
a month ago (0.1.0)
@qfetch/core
Core framework for composable fetch middlewares.
Overview
Provides TypeScript types and composition utilities for building middleware that wraps the native fetch API. Create reusable request/response processing logic through a clean middleware pattern.
Installation
npm install @qfetch/core
API
Types
FetchFunction- Compatible with native fetch APIMiddlewareExecutor- Function that wraps a fetch function with middleware logicMiddleware<T>- Factory for creating middleware executors with optional configuration
Composition
compose(...middlewares)- Right-to-left composition (functional style)pipeline(...middlewares)- Left-to-right composition (pipeline style)
Usage
import { compose, pipeline, type Middleware } from '@qfetch/core'; // Create a simple middleware const withLogger: Middleware = () => (next) => async (input, init) => { console.log('Request:', input); const response = await next(input, init); console.log('Response:', response.status); return response; }; // Compose with other middlewares const qfetch = compose( withLogger(), // other middlewares... )(fetch); // Or use pipeline for left-to-right execution const qfetch2 = pipeline( withLogger(), // other middlewares... )(fetch);
Built and signed on
GitHub Actions
Add Package
deno add jsr:@qfetch/core
Import symbol
import * as core from "@qfetch/core";
Import directly with a jsr specifier
import * as core from "jsr:@qfetch/core";
Add Package
pnpm i jsr:@qfetch/core
pnpm dlx jsr add @qfetch/core
Import symbol
import * as core from "@qfetch/core";
Add Package
yarn add jsr:@qfetch/core
yarn dlx jsr add @qfetch/core
Import symbol
import * as core from "@qfetch/core";
Add Package
vlt install jsr:@qfetch/core
Import symbol
import * as core from "@qfetch/core";
Add Package
npx jsr add @qfetch/core
Import symbol
import * as core from "@qfetch/core";
Add Package
bunx jsr add @qfetch/core
Import symbol
import * as core from "@qfetch/core";