1.0.5 • Published 6 years ago

acyort-fetcher v1.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

acyort-fetcher

Build Status codecov

Fetcher for AcyOrt

Install

$ npm i acyort-fetcher -S

Usage

const Fetcher = require('acyort-fetcher')

const config = {
  user: 'LoeiFy',         // github username
  repository: 'Recordum', // github repository
  order: 'created',       // 'created' or 'updated'
  cache: false,           // if cache json data. create a json file in current path
  base: process.cwd(),    // current path
  token: 'xxxx'           // github access token
}
const fetcher = new Fetcher(config)
const { axios, getGithub } = fetcher

axios(...config)          // axios
getGithub(...config)      // axios width github headers, github token

fetcher.status = status => {
  console.log(status)     // requests information
}

// add custom headers
fetcher.setHeaders({ Accept: 'application/vnd.github.v3.full' })

fetcher.fetch()
  .then(res => console.log(res))    // the json data
  .catch(err => console.log(err))   // error
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago