This is a small, zero requirements and simple library for creating HTTP clients. It uses simple approach by providing an api around native fetch(but can be overridden by setting your calling mechanism) in a configurable and functional manner.
bun add @zemd/http-client
npm install @zemd/http-client
yarn install @zemd/http-client
pnpm add @zemd/http-client
import { compose, method, json } from "@zemd/http-client";
const myfetch = compose([method("POST"), json()], fetch);
const resp = await myfetch("https://example.com");
As you can see the idea is very simple, and real power comes when you start composing different configurations together and creating your client.
A real example you can find in ../apis/
folder.
An example of how you can use the library in your project see src/example.ts
@zemd/http-client
released under the Apache 2.0 license