1.1.6 • Published 5 years ago
hey-quest v1.1.6
Hey Quest
A promise based light-weight module that aims to make HTTP requests clean, intuitive, reusable and understandable.
Features
- Easy to use
- Clean syntax
- Intuitive
- Lightweight
Installing
Using npm:
$ npm install hey-quest
Using yarn:
$ yarn add hey-quest
Usage
We don't recommend using .then() and .catch
// Import hey-quest
const hey = require('hey-quest')
// Declare an async function
async function example(){
try{
// Configure the request and call it with ".do()"
const res = await hey('https://jsonplaceholder.typicode.com/todos/1').do()
// Convert the response into a javascript object
const json = await res.json()
// Logs the json
console.log(json)
}catch(e){
// Inform an error if the request failed
console.error(e)
}
}
// Call the above function
example()
Credits
Hey-quest is a library made by Francisco Cidade (@FranckCid).
Hey-quest is heavily inspired on axios.
License
MIT