@crawlee/basic 4.0.0-beta.100 → 4.0.0-beta.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,9 @@
1
- import { writeFile } from 'node:fs/promises';
1
+ import { mkdir, writeFile } from 'node:fs/promises';
2
2
  import { dirname } from 'node:path';
3
3
  import { AutoscaledPool, bindMethodsToServiceLocator, BLOCKED_STATUS_CODES, ConcurrencySystem, ContextPipeline, ContextPipelineCleanupError, ContextPipelineInitializationError, ContextPipelineInterruptedError, CriticalError, Dataset, enqueueLinks, EnqueueStrategy, getObjectType, KeyValueStore, log, LogLevel, mergeCookies, MissingSessionError, NavigationSkippedError, NonRetryableError, OwnedOrInjected, purgeDefaultStorages, RequestHandlerError, RequestManagerTandem, RequestQueue, RequestState, RetryRequestError, Router, ServiceLocator, serviceLocator, Session, SessionError, SessionPool, Statistics, validateUserData, validators, } from '@crawlee/core';
4
4
  import { FetchHttpClient } from '@crawlee/http-client';
5
5
  import { isAsyncIterable, isIterable, RobotsTxtFile, ROTATE_PROXY_ERRORS } from '@crawlee/utils';
6
6
  import { stringify } from 'csv-stringify/sync';
7
- import { ensureDir, writeJSON } from 'fs-extra/esm';
8
7
  import ow, { ArgumentError } from 'ow';
9
8
  import { getDomain } from 'tldts';
10
9
  import { LruCache } from '@apify/datastructures';
@@ -1074,13 +1073,13 @@ export class BasicCrawler {
1074
1073
  }),
1075
1074
  ]);
1076
1075
  }
1077
- await ensureDir(dirname(path));
1076
+ await mkdir(dirname(path), { recursive: true });
1078
1077
  await writeFile(path, value);
1079
1078
  this.log.info(`Export to ${path} finished!`);
1080
1079
  }
1081
1080
  if (format === 'json') {
1082
- await ensureDir(dirname(path));
1083
- await writeJSON(path, items, { spaces: 4 });
1081
+ await mkdir(dirname(path), { recursive: true });
1082
+ await writeFile(path, `${JSON.stringify(items, null, 4)}\n`);
1084
1083
  this.log.info(`Export to ${path} finished!`);
1085
1084
  }
1086
1085
  return items;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/basic",
3
- "version": "4.0.0-beta.100",
3
+ "version": "4.0.0-beta.101",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -42,19 +42,18 @@
42
42
  "@apify/datastructures": "^2.0.0",
43
43
  "@apify/timeout": "^0.4.4",
44
44
  "@apify/utilities": "^2.15.5",
45
- "@crawlee/core": "4.0.0-beta.100",
46
- "@crawlee/http-client": "4.0.0-beta.100",
47
- "@crawlee/types": "4.0.0-beta.100",
48
- "@crawlee/utils": "4.0.0-beta.100",
45
+ "@crawlee/core": "4.0.0-beta.101",
46
+ "@crawlee/http-client": "4.0.0-beta.101",
47
+ "@crawlee/types": "4.0.0-beta.101",
48
+ "@crawlee/utils": "4.0.0-beta.101",
49
49
  "csv-stringify": "^6.5.2",
50
- "fs-extra": "^11.3.0",
51
50
  "ow": "^2.0.0",
52
51
  "tldts": "^7.0.6",
53
52
  "tslib": "^2.8.1",
54
53
  "type-fest": "^4.41.0"
55
54
  },
56
55
  "optionalDependencies": {
57
- "@crawlee/impit-client": "^4.0.0-beta.100"
56
+ "@crawlee/impit-client": "^4.0.0-beta.101"
58
57
  },
59
58
  "lerna": {
60
59
  "command": {
@@ -63,5 +62,5 @@
63
62
  }
64
63
  }
65
64
  },
66
- "gitHead": "109b4c2097f7b9a26bfe761b3c9969dd626f8e38"
65
+ "gitHead": "1fd886ee601c053d6fa8cada24b751f9cbe0a539"
67
66
  }