v4.0.0
The module is now ESM only
This means you have to import it by using an import
expression, or the import()
method. You can do so by either migrating your project to ESM, or importing got-scraping
in an async context
-const { gotScraping } = require('got-scraping');
+import { gotScraping } from 'got-scraping';
If you cannot migrate to ESM, here's an example of how to import it in an async context:
let gotScraping;
async function fetchWithGotScraping(url) {
gotScraping ??= (await import('got-scraping')).gotScraping;
return gotScraping.get(url);
}
What's Changed
- feat: add export of hooks and TransformHeadersAgent by @foxt451 in #102
- feat: ESM migration of got-scraping by @vladfrangu in #109
- feat: add Cloudflare blocking benchmarking by @barjin in #114
New Contributors
Full Changelog: v3.2.15...v4.0.0