Skip to content

Remove dependency "request" #360

@mikeharder

Description

@mikeharder

Dependency request is no longer maintained and should be removed.

"request": "^2.88.0",

It should be fairly easy to replace this one usage:

const res = makeRequest({ url: specPath, errorOnNon200Response: true })

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions