Skip to content

Commit

Permalink
Replace deprecated request-promise library with node-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
amiedes committed Feb 10, 2022
1 parent c76e2a2 commit 01862dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/httpadapter/requestadapter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var HttpError = require('../error/httperror.js');
var request = require('request-promise');
var fetch = require('node-fetch');

/**
* RequestAdapter
Expand Down Expand Up @@ -43,7 +43,7 @@ RequestAdapter.prototype.get = function(url, params, callback) {
}
}

return request(options).then(function handleResponse(response) {
return fetch(options).then(function handleResponse(response) {
return response.body;
})
.catch(function(error) {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"dependencies": {
"bluebird": "^3.5.2",
"node-fetch": "^2.6.0",
"request": "^2.88.0",
"request-promise": "^4.2.2"
"request": "^2.88.0"
},
"devDependencies": {
"chai": "^3.5.0",
Expand Down

0 comments on commit 01862dd

Please sign in to comment.