-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Dependency request
is no longer maintained and should be removed.
Line 27 in 41c3493
"request": "^2.88.0", |
It should be fairly easy to replace this one usage:
openapi-diff/src/lib/util/utils.ts
Line 59 in 41c3493
const res = makeRequest({ url: specPath, errorOnNon200Response: true }) |
openapi-diff/src/lib/util/utils.ts
Lines 151 to 153 in 41c3493
export function makeRequest(options: Options) { | |
const promise = new Promise(function (resolve, reject) { | |
request(options, function (err: unknown, response: Response, responseBody: string) { |
With the fetch()
API built-in to Node >= 20. It was experimental in 20, but we should still be able to use it. Something like:
const response = await fetch(specPath);
const res = await response.text();
https://nodejs.org/docs/latest-v20.x/api/globals.html#fetch
https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch
Metadata
Metadata
Assignees
Labels
No labels