zenio
v0.0.8
Published
HTTP request with Promise
Downloads
433
Readme
zenio
HTTP request with Promise
Install
npm install zenio --save
Usage
const zenio = require('zenio')
(async function() {
zenio.setOptions({
json: true
})
let repo = await zenio.get('https://api.github.com/repos/junyiz/zenio', null, {
'User-Agent': 'zenio'
})
console.log('repo id:', repo.id, 'repo name:', repo.full_name)
})()
or
const zenio = require('zenio')
zenio.setOptions({
json: true
})
zenio.get('https://api.github.com/repos/junyiz/zenio', null, {
'User-Agent': 'zenio'
}).then(function (repo) {
console.log('repo id:', repo.id, 'repo name:', repo.full_name)
}).catch(console.error)
License
MIT