@outloud/reqo
v2.0.1
Published
HTTP client based on Fetch API with built-in support for retries, timeouts, and JSON handling.
Readme
Reqo
HTTP client based on Fetch API with built-in support for retries, timeouts, and JSON handling.
Installation
npm install @outloud/reqoUsage
import { reqo } from '@outloud/reqo'
const data = await reqo.$get<{ status: boolean }>('https://api.example.com/data', {
query: { verbose: true },
retry: { limit: 3 },
timeout: 5000
})
console.log(data) // { status: true }With an OpenAPI schema generated by openapi-typescript, requests are fully typed:
import { createSchemaClient } from '@outloud/reqo'
import type { paths } from './api.js'
const api = createSchemaClient<paths>({ url: 'https://api.example.com' })
const event = await api.$get('/special-events/{eventId}', {
params: { eventId: '123' }
})Documentation
To learn more, check documentation.
