npm.io
0.4.14 • Published 6 years ago

@cafebazaar/hod

Licence
MIT
Version
0.4.14
Deps
2
Size
102 kB
Vulns
0
Weekly
0

Hod

Hod is a HTTP service based on fetch API.

Installation

$ npm i @cafebazaar/hod
$ yarn add @cafebazaar/hod

Basic Usage

import Hod from '@cafebazaar/hod';

Hod.get('http://to.com/:id', {
  params: {
    id: 1,
  },
}).then(( res ) =>{
  console.log(res) // response
  console.log(res.data) // parsed response
}).catch(({ type, typeCode, details }) => {
  console.log(type, typeCode, details)
})