0.4.0 • Published 2 years ago

@mild-ts/rest-client v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@mild-ts/rest-client

Lightweight REST client helper function wrapping with type and Axios

CI npm.io

Introduction

Lightweight REST client helper function with basic type support and Axios wrapper. However, if you need more type-safety, we recommend considering untypeable.

Alternatively, if you have control over both the server and client types, options like tRPC or GraphQL are great choices. So go ahead and choose the option that works best for your needs!

Installation

npm i @mild-ts/rest-client

Examples

import { RestClient } from '@mild-ts/rest-client';

async function main() {
  const client = new RestClient();
  const res = await client.request('GET https://jsonplaceholder.typicode.com/posts/{postId}/comments', {
    params: {
      postId: 1,
    },
  });
  console.log(res.data);
}

main();

API

to be add later

0.4.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago