Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
fix CLI
Martin Adámek8952c78ab05e
diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.tsindex 46f314442..168b6f786 100755--- a/packages/cli/src/index.ts+++ b/packages/cli/src/index.ts@@ -7,16 +7,17 @@ import { InstallPlaywrightBrowsersCommand } from './commands/InstallPlaywrightBrimport { RunProjectCommand } from './commands/RunProjectCommand.js';+import { createRequire } from 'node:module';import yargs from 'yargs';+const require = createRequire(import.meta.url);+function getCLIVersion(): string {try {// this works during development (where we have `src` folder)- // eslint-disable-next-linereturn require('../package.json').version;} catch {// this works in production build (where we do not have the `src` folder)- // eslint-disable-next-linereturn require('./package.json').version;}}diff --git a/packages/crawlee/src/cli.ts b/packages/crawlee/src/cli.tsindex e776789f5..1f02cac45 100755--- a/packages/crawlee/src/cli.ts+++ b/packages/crawlee/src/cli.ts@@ -1,9 +1,9 @@#!/usr/bin/env node-// eslint-disable-next-line-const importLocal = require('import-local');+import importLocal from 'import-local';-if (!importLocal(__filename)) {+// @ts-ignore bad types most likely?+if (!importLocal(import.meta.url)) {// eslint-disable-next-linerequire('@crawlee/cli');}