got-scraping
Advanced tools
Comparing version 4.0.0-beta.1 to 4.0.0-beta.2
{ | ||
"name": "got-scraping", | ||
"version": "4.0.0-beta.1", | ||
"version": "4.0.0-beta.2", | ||
"description": "HTTP client made for scraping based on got.", | ||
"engines": { | ||
"node": ">=18" | ||
"node": ">=16" | ||
}, | ||
@@ -8,0 +8,0 @@ "files": [ |
@@ -12,4 +12,6 @@ # Got Scraping | ||
**Note:** | ||
> - Node.js >=15.10.0 is required due to instability of HTTP/2 support in lower versions. | ||
> This project is ESM only, which means it can only be imported using the `import` statement or the `import()` method. It is not possible to `require()` it. | ||
> - Node.js >=16 is required due to instability of HTTP/2 support in lower versions. | ||
## API | ||
@@ -22,9 +24,20 @@ | ||
```javascript | ||
const { gotScraping } = require('got-scraping'); | ||
import { gotScraping } from 'got-scraping'; | ||
gotScraping | ||
.get('https://apify.com') | ||
.then( ({ body }) => console.log(body)) | ||
.then( ({ body }) => console.log(body)); | ||
``` | ||
```javascript | ||
// If you're still using CJS and cannot use the import syntax | ||
let gotScraping; | ||
async function fetchWithGotScraping(url) { | ||
gotScraping ??= (await import('got-scraping')).gotScraping; | ||
return gotScraping.get(url); | ||
} | ||
``` | ||
### options | ||
@@ -39,3 +52,3 @@ | ||
```javascript | ||
const { gotScraping } = require('got-scraping'); | ||
import { gotScraping } from 'got-scraping'; | ||
@@ -47,3 +60,3 @@ gotScraping | ||
}) | ||
.then(({ body }) => console.log(body)) | ||
.then(({ body }) => console.log(body)); | ||
``` | ||
@@ -50,0 +63,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161788
148