intra42-fetch

2.0.6 • Public • Published

Intra42-fetch

This is a little package which wrap node-fetch for request the api of the 42 school.

How to use it ?

const Intra42 = require('intra42-fetch')

// Instantiate the Intra42 class and provide your id and secret.

const intra42 = new Intra42(id, secret)

// Intra42.fetch is just a pre-applyed fetch with your token, use it like the fetch API

intra42.fetch('/v2/users')
  .then(json => console.log(json)) // Response.json is used so you'll get json automatically
  .catch(err => console.log(err)) // if the parsing failed the handle the error

Readme

Keywords

Package Sidebar

Install

npm i intra42-fetch

Weekly Downloads

2

Version

2.0.6

License

ISC

Unpacked Size

2.1 kB

Total Files

3

Last publish

Collaborators

  • m-vinc