@azury/fetch
v0.7.0
Published
azury's fetch client
Downloads
18
Readme
fetch
Setup
Deno
import fetch from 'https://deno.land/x/[email protected]/mod.ts'
Node.js
npm i @azury/fetch
import fetch from '@azury/fetch'
Usage
const client = new fetch()
// optionally, you can specify global headers and a base path
const client = new fetch({
base: 'https://',
headers: {
authorization: 'bearer token'
}
})
const { data, error, code, ... } = await client.get('example.com', { type: 'json' }) // fetches 'https://example.com' and parses the response body as json