Async
You don't have to use .then
all the time, but you can use async.
Example code
const hyttpo = require('hyttpo').default;
(async() => {
const res = await hyttpo.request({
method: 'GET',
url: 'https://api.ipify.org/?format=json'
}).catch(e => e)
console.log(res);
})();
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Learn
You can read more about async hereopen in new window