@zemd/http-client
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

@zemd/http-client

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.

Installation

bun add @zemd/http-client
npm install @zemd/http-client
yarn install @zemd/http-client
pnpm add @zemd/http-client

Usage

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

License

@zemd/http-client released under the Apache 2.0 license

Donate

Readme

Keywords

none

Package Sidebar

Install

npm i @zemd/http-client

Weekly Downloads

2

Version

3.0.1

License

Apache-2.0

Unpacked Size

36.1 kB

Total Files

9

Last publish

Collaborators

  • hunterman