Skip to content

Minimal wrapper around fetch for an easier API.

Notifications You must be signed in to change notification settings

matheusbn/fxtch

Repository files navigation

fxtch

codecov npm bundle size npm

Minimal wrapper around fetch for an easier API.

Install

npm i fxtch

Example

await fxtch("https://example.com")

await fxtch
  .post("https://example.com")
  .set("Authorization", "Bearer <token>")  
  .send({ name: "Matheus" })

fxtch
  .get("https://example.com")
  .query({ limit: 50 })
  .then(console.log)

const api = fxtch
  .client()
  .baseUrl('https://example.com/')
  .set({ Authorization: 'blabla' })

await api.post('/users')
await api.post('/users')

About

Minimal wrapper around fetch for an easier API.

Resources

Stars

Watchers

Forks