bexxcv 1.0.5 → 1.0.6

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.
package/README.md CHANGED
@@ -183,8 +183,6 @@ import { launchOptions } from "bexxcv";
183
183
  import { getPossiblePairs } from "bexxcv/webgl"; // if you re-export it
184
184
  ```
185
185
 
186
- ---
187
-
188
186
  ### `turnstile`
189
187
 
190
188
  Background solver for Cloudflare Turnstile checkboxes, similar to the `turnstile` option in puppeteer-real-browser.
@@ -432,6 +430,20 @@ npx bexxcv server # Start a Playwright remote server
432
430
 
433
431
  ## Exports
434
432
 
433
+ ### Module formats
434
+
435
+ bexxcv is an ES module package. It also works from CommonJS on Node.js 22.12 or newer, where `require()` can load ES modules.
436
+
437
+ ```js
438
+ import { bexxcv } from "bexxcv";
439
+ ```
440
+
441
+ ```js
442
+ const { bexxcv } = require("bexxcv");
443
+ ```
444
+
445
+ On older Node.js versions load it with `const { bexxcv } = await import("bexxcv");`. TypeScript projects that compile to CommonJS need TypeScript 5.8 or newer with `module` set to `nodenext`.
446
+
435
447
  ```ts
436
448
  // Main entry — everything
437
449
  import { bexxcv, Camoufox, NewBrowser, launchOptions, VirtualDisplay } from "bexxcv";
@@ -604,4 +616,4 @@ You passed a fingerprint generated for Chrome or Safari. bexxcv only accepts Fir
604
616
 
605
617
  ## License
606
618
 
607
- MPL-2.0 — same as the upstream [camoufox-js](https://github.com/apify/camoufox-js).
619
+ MPL-2.0 — same as the upstream [camoufox-js](https://github.com/apify/camoufox-js).
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { launchServer } from "./server.js";
2
- export { Bexxcv, Camoufox, NewBrowser, type BexxcvOptions } from "./sync_api.js";
2
+ export { Bexxcv, Bexxcv as bexxcv, Camoufox, NewBrowser, type BexxcvOptions, } from "./sync_api.js";
3
3
  export { type LaunchOptions, launchOptions } from "./utils.js";
4
4
  export { VirtualDisplay } from "./virtdisplay.js";
5
5
  export { needsXvfb, startXvfb, withXvfb } from "./xvfb.js";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { launchServer } from "./server.js";
2
- export { Bexxcv, Camoufox, NewBrowser } from "./sync_api.js";
2
+ export { Bexxcv, Bexxcv as bexxcv, Camoufox, NewBrowser, } from "./sync_api.js";
3
3
  export { launchOptions } from "./utils.js";
4
4
  export { VirtualDisplay } from "./virtdisplay.js";
5
5
  export { needsXvfb, startXvfb, withXvfb } from "./xvfb.js";
@@ -0,0 +1,2 @@
1
+ export declare function between(min: number, max: number): number;
2
+ export declare function sleep(ms: number): Promise<void>;
package/dist/random.js ADDED
@@ -0,0 +1,8 @@
1
+ export function between(min, max) {
2
+ const buf = new Uint32Array(1);
3
+ crypto.getRandomValues(buf);
4
+ return min + (buf[0] / 4294967296) * (max - min);
5
+ }
6
+ export function sleep(ms) {
7
+ return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
8
+ }
package/dist/turnstile.js CHANGED
@@ -1,11 +1,6 @@
1
1
  import { onEachPage } from "./pagehooks.js";
2
+ import { between, sleep } from "./random.js";
2
3
  const WATCHED = new WeakSet();
3
- function sleep(ms) {
4
- return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
5
- }
6
- function between(min, max) {
7
- return min + Math.random() * (max - min);
8
- }
9
4
  async function findWidgets(page) {
10
5
  return page.evaluate(() => {
11
6
  const out = [];
package/dist/uam.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { onEachPage } from "./pagehooks.js";
2
+ import { between, sleep } from "./random.js";
2
3
  const CHALLENGE_TITLES = [
3
4
  "just a moment",
4
5
  "tunggu sebentar",
@@ -12,12 +13,6 @@ const CHALLENGE_TITLES = [
12
13
  ];
13
14
  const WATCHED = new WeakSet();
14
15
  const BUSY = new WeakSet();
15
- function sleep(ms) {
16
- return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
17
- }
18
- function between(min, max) {
19
- return min + Math.random() * (max - min);
20
- }
21
16
  async function isChallenge(page) {
22
17
  const title = (await page.title().catch(() => "")).toLowerCase();
23
18
  return CHALLENGE_TITLES.some((t) => title.includes(t));
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "bexxcv",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
7
7
  "build": "rimraf dist && tsc && pnpm copy-files",
8
8
  "test": "vitest",
9
- "copy-files": "mkdir -p dist/data-files && cp -r src/data-files/. dist/data-files/",
10
- "prepack": "pnpm build && node scripts/verify-package.mjs",
9
+ "copy-files": "cp -r src/data-files dist/data-files",
11
10
  "check": "biome check",
12
11
  "fetch": "node dist/__main__.js fetch"
13
12
  },
@@ -33,7 +32,7 @@
33
32
  "url": "https://github.com/fidzzcodex-me/bexxcv/issues"
34
33
  },
35
34
  "engines": {
36
- "node": ">= 22"
35
+ "node": ">= 22.12"
37
36
  },
38
37
  "license": "MPL-2.0",
39
38
  "description": "High-performance stealth Firefox automation. Fork of camoufox-js with parallel IP resolution, crypto-grade fingerprint seeds, exponential backoff, and zero-config Xvfb.",
@@ -82,24 +81,34 @@
82
81
  },
83
82
  "exports": {
84
83
  ".": {
84
+ "types": "./dist/index.d.ts",
85
85
  "import": "./dist/index.js",
86
- "types": "./dist/index.d.ts"
86
+ "require": "./dist/index.js",
87
+ "default": "./dist/index.js"
87
88
  },
88
89
  "./xvfb": {
90
+ "types": "./dist/xvfb.d.ts",
89
91
  "import": "./dist/xvfb.js",
90
- "types": "./dist/xvfb.d.ts"
92
+ "require": "./dist/xvfb.js",
93
+ "default": "./dist/xvfb.js"
91
94
  },
92
95
  "./virtdisplay": {
96
+ "types": "./dist/virtdisplay.d.ts",
93
97
  "import": "./dist/virtdisplay.js",
94
- "types": "./dist/virtdisplay.d.ts"
98
+ "require": "./dist/virtdisplay.js",
99
+ "default": "./dist/virtdisplay.js"
95
100
  },
96
101
  "./exceptions": {
102
+ "types": "./dist/exceptions.d.ts",
97
103
  "import": "./dist/exceptions.js",
98
- "types": "./dist/exceptions.d.ts"
104
+ "require": "./dist/exceptions.js",
105
+ "default": "./dist/exceptions.js"
99
106
  },
100
107
  "./selfupdate": {
108
+ "types": "./dist/selfupdate.d.ts",
101
109
  "import": "./dist/selfupdate.js",
102
- "types": "./dist/selfupdate.d.ts"
110
+ "require": "./dist/selfupdate.js",
111
+ "default": "./dist/selfupdate.js"
103
112
  }
104
113
  }
105
114
  }
Binary file