cross-fetch icon indicating copy to clipboard operation
cross-fetch copied to clipboard

Add support for agent property from node-fetch

Open RikudouSage opened this issue 2 years ago • 1 comments

I'd like to ignore https errors for one specific endpoint using node.js.

In node-fetch this can be done using the agent property, the problem is that it's not exposed in typescript so the code doesn't transpile. Currently I've "solved" it by retyping it as any which is far from ideal.

Adding support for the agent property would be great.

RikudouSage avatar Oct 18 '23 15:10 RikudouSage

I agree. I instead used ts-ignore like:

const req = await fetch(..., {
   ...
   // @ts-ignore
   agent: ...
});

cross-fetch version: 4.0.0

lewisjr avatar Nov 22 '23 23:11 lewisjr