codemanki / cloudscraper

--DEPRECATED -- 🛑 🛑 Node.js library to bypass cloudflare's anti-ddos page
MIT License
600 stars 139 forks source link

Add typescript definitions and tests #267

Closed ghost closed 4 years ago

ghost commented 4 years ago

Closes #265

ghost commented 4 years ago

@lillem4n

lillem4n commented 4 years ago

This is golden, thank you so much!

etnann commented 4 years ago

Could you write an example of how to import and use the library using typescript? I tried with

import * as cloudscraper from "cloudscraper";
let html_doc = await cloudscraper(options);

but Visual Studio code shows me an error: This expression is not callable. Type 'CloudscraperAPI' has no call signatures

lillem4n commented 4 years ago

import cloudscraper from 'cloudscraper'; should be enough. We're using it like this with TS 3.7.2.