File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " pokedex-api" ,
3- "version" : " 1.1.0 " ,
3+ "version" : " 1.1.1 " ,
44 "description" : " A wrapper library for the Pokédex API. Get all your Pokémon Needs in one place." ,
55 "main" : " index.js" ,
66 "scripts" : {
3232 "eslint" : " ^4.17.0"
3333 },
3434 "dependencies" : {
35- "request" : " ^2.83.0" ,
36- "request-promise-native" : " ^1.0.5"
35+ "got" : " ^8.1.0"
3736 }
3837}
Original file line number Diff line number Diff line change 55 */
66
77const config = require ( '../settings/config.json' ) ;
8- const request = require ( 'request-promise-native ' ) ;
8+ const request = require ( 'got ' ) ;
99
1010/**
1111 * @class Pokedex
@@ -46,16 +46,15 @@ class Pokedex {
4646 this . makeRequest = async function ( path ) {
4747 try {
4848 let options = {
49- uri : `${ this . BASE_URL } ${ path } ` ,
5049 headers : {
5150 'User-Agent' : this . USER_AGENT ,
5251 'Auth' : this . AUTH
5352 } ,
5453 json : true
5554 } ;
5655
57- let response = await request ( options ) ;
58- return response ;
56+ let response = await request ( ` ${ this . BASE_URL } ${ path } ` , options ) ;
57+ return response . body ;
5958 }
6059 catch ( e ) {
6160 throw e ;
You can’t perform that action at this time.
0 commit comments