lenconda / free-proxy

Fetch free proxies from https://www.free-proxy-list.com
MIT License
16 stars 5 forks source link

typescript error in constructor definition #8

Open ericblade opened 1 year ago

ericblade commented 1 year ago

Documentation says to do this:

import ProxyList from 'free-proxy';
const proxyList = new ProxyList();

which results in this

image

works fine with a @ts-ignore but that's not really a good thing to be doing.

also, it's not clear why it's intended to be used in this fashion, as it performs a get() before doing any operations, so it's not like it needs to be constructed to maintain it's own internal cache or something (although i do see that there is a cache, it looks like it's not really implemented), and it could just be a module. of course, modules can implement their own internal things.