1- [ ![ version(scoped)] ( https://img.shields.io/npm/v/openapi-typescript-fetch.svg )] ( https://www.npmjs.com/package/openapi-typescript-fetch )
2- [ ![ codecov] ( https://codecov.io/gh/ajaishankar/openapi-typescript-fetch/branch/main/graph/badge.svg?token=Z8GQ6M5KAR )] ( https://codecov.io/gh/ajaishankar/openapi-typescript-fetch )
1+ # 📘️ @cuppachino/openapi-fetch
32
4- # 📘️ openapi-typescript -fetch
3+ [ ![ version(scoped) ] ( https://img.shields.io/npm/v/@cuppachino/ openapi-fetch.svg )] ( https://www.npmjs.com/package/@cuppachino/openapi -fetch)
54
6- A typed fetch client for [ openapi-typescript] ( https://github.com/drwpow/openapi-typescript )
5+ A typed fetch client for [ openapi-typescript] ( https://github.com/drwpow/openapi-typescript )
76
87### Install
98
109``` bash
11- npm install openapi-typescript -fetch
10+ npm install @cuppachino/ openapi-fetch
1211```
12+
1313Or
14+
1415``` bash
15- yarn add openapi-typescript -fetch
16+ yarn add @cuppachino/ openapi-fetch
1617```
1718
1819** Features**
@@ -38,7 +39,7 @@ npx openapi-typescript https://petstore.swagger.io/v2/swagger.json --output pets
3839``` ts
3940import ' whatwg-fetch'
4041
41- import { Fetcher } from ' openapi-typescript -fetch'
42+ import { Fetcher } from ' @cuppachino/ openapi-fetch'
4243
4344import { paths } from ' ./petstore'
4445
@@ -105,7 +106,7 @@ Middlewares can be used to pre and post process fetch operations (log api calls,
105106
106107``` ts
107108
108- import { Middleware } from ' openapi-typescript -fetch'
109+ import { Middleware } from ' @cuppachino/ openapi-fetch'
109110
110111const logger: Middleware = async (url , init , next ) => {
111112 console .log (` fetching ${url } ` )
@@ -130,6 +131,7 @@ fetcher.use(logger)
130131This library can be used server side with [ node-fetch] ( https://www.npmjs.com/package/node-fetch )
131132
132133Node CommonJS setup
134+
133135``` ts
134136// install node-fetch v2
135137npm install node - fetch @2
@@ -190,4 +192,4 @@ const body = arrayRequestBody([{ item: 1}], { param: 2})
190192// body type is { item: number }[] & { param: number }
191193```
192194
193- Happy fetching! 👍
195+ Happy fetching! 👍
0 commit comments