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

1.0.0 • 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 install @zemd/http-client
npm install @zemd/http-client
yarn install @zemd/http-client
pnpm install @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.

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

0

Version

1.0.0

License

Apache-2.0

Unpacked Size

18.6 kB

Total Files

5

Last publish

Collaborators

  • hunterman