zenio

HTTP request with Promise

  • zenio

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
zenio
110.0.86 years ago7 years agoMinified + gzip package size for zenio in KB

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