@xberg-io/crawlberg 1.11.1 → 1.12.2

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.
Files changed (5) hide show
  1. package/binding.cjs +138 -0
  2. package/index.d.ts +144 -16
  3. package/index.js +583 -437
  4. package/index.mjs +47 -0
  5. package/package.json +12 -9
package/index.js CHANGED
@@ -2,554 +2,710 @@
2
2
  // @ts-nocheck
3
3
  /* auto-generated by NAPI-RS */
4
4
 
5
- const { readFileSync } = require('fs')
6
- let nativeBinding = null
5
+ const { readFileSync } = require("fs");
6
+ let nativeBinding = null;
7
7
  // Which artifact actually loaded. The WASI fallback chain overwrites it with
8
8
  // the flavor it resolved; the late native retry below leaves it alone because
9
9
  // it only runs while no WASI candidate has been loaded.
10
- let __napiLoadedBindingTarget = 'native'
11
- const loadErrors = []
10
+ let __napiLoadedBindingTarget = "native";
11
+ const loadErrors = [];
12
12
 
13
13
  const isMusl = () => {
14
- let musl = false
15
- if (process.platform === 'linux') {
16
- musl = isMuslFromFilesystem()
14
+ let musl = false;
15
+ if (process.platform === "linux") {
16
+ musl = isMuslFromFilesystem();
17
17
  if (musl === null) {
18
- musl = isMuslFromReport()
18
+ musl = isMuslFromReport();
19
19
  }
20
20
  if (musl === null) {
21
- musl = isMuslFromChildProcess()
21
+ musl = isMuslFromChildProcess();
22
22
  }
23
23
  }
24
- return musl
25
- }
24
+ return musl;
25
+ };
26
26
 
27
- const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
27
+ const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
28
28
 
29
29
  const isMuslFromFilesystem = () => {
30
30
  try {
31
- return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
31
+ return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
32
32
  } catch {
33
- return null
33
+ return null;
34
34
  }
35
- }
35
+ };
36
36
 
37
37
  const isMuslFromReport = () => {
38
- let report = null
39
- if (process.report && typeof process.report.getReport === 'function') {
40
- process.report.excludeNetwork = true
41
- report = process.report.getReport()
38
+ let report = null;
39
+ if (process.report && typeof process.report.getReport === "function") {
40
+ process.report.excludeNetwork = true;
41
+ report = process.report.getReport();
42
42
  }
43
43
  if (!report) {
44
- return null
44
+ return null;
45
45
  }
46
46
  if (report.header && report.header.glibcVersionRuntime) {
47
- return false
47
+ return false;
48
48
  }
49
49
  if (Array.isArray(report.sharedObjects)) {
50
50
  if (report.sharedObjects.some(isFileMusl)) {
51
- return true
51
+ return true;
52
52
  }
53
53
  }
54
- return false
55
- }
54
+ return false;
55
+ };
56
56
 
57
57
  const isMuslFromChildProcess = () => {
58
58
  try {
59
- return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
59
+ return require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
60
60
  } catch (e) {
61
61
  // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
62
- return false
62
+ return false;
63
63
  }
64
- }
64
+ };
65
65
 
66
66
  function requireNative() {
67
67
  if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
68
68
  try {
69
- const overrideBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
69
+ const overrideBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
70
70
  // The override may be a generated WASI loader, which already reports its
71
71
  // own flavor. Adopt it: `module.exports` aliases this object, so claiming
72
72
  // 'native' would both misreport the artifact and overwrite the loader's
73
73
  // marker through the alias.
74
74
  __napiLoadedBindingTarget =
75
- overrideBinding && typeof overrideBinding.__napiBindingTarget === 'string'
75
+ overrideBinding && typeof overrideBinding.__napiBindingTarget === "string"
76
76
  ? overrideBinding.__napiBindingTarget
77
- : 'native'
78
- return overrideBinding
77
+ : "native";
78
+ return overrideBinding;
79
79
  } catch (err) {
80
- loadErrors.push(err)
80
+ loadErrors.push(err);
81
81
  }
82
- } else if (process.platform === 'android') {
83
- if (process.arch === 'arm64') {
82
+ } else if (process.platform === "android") {
83
+ if (process.arch === "arm64") {
84
84
  try {
85
- return require('./crawlberg-node.android-arm64.node')
85
+ return require("./crawlberg-node.android-arm64.node");
86
86
  } catch (e) {
87
- loadErrors.push(e)
87
+ loadErrors.push(e);
88
88
  }
89
89
  try {
90
- const binding = require('@xberg-io/crawlberg-android-arm64')
91
- const bindingPackageVersion = require('@xberg-io/crawlberg-android-arm64/package.json').version
92
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
93
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
94
- }
95
- return binding
90
+ const binding = require("@xberg-io/crawlberg-android-arm64");
91
+ const bindingPackageVersion = require("@xberg-io/crawlberg-android-arm64/package.json").version;
92
+ if (
93
+ bindingPackageVersion !== require("./package.json").version &&
94
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
95
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
96
+ ) {
97
+ throw new Error(
98
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
99
+ );
100
+ }
101
+ return binding;
96
102
  } catch (e) {
97
- loadErrors.push(e)
103
+ loadErrors.push(e);
98
104
  }
99
- } else if (process.arch === 'arm') {
105
+ } else if (process.arch === "arm") {
100
106
  try {
101
- return require('./crawlberg-node.android-arm-eabi.node')
107
+ return require("./crawlberg-node.android-arm-eabi.node");
102
108
  } catch (e) {
103
- loadErrors.push(e)
109
+ loadErrors.push(e);
104
110
  }
105
111
  try {
106
- const binding = require('@xberg-io/crawlberg-android-arm-eabi')
107
- const bindingPackageVersion = require('@xberg-io/crawlberg-android-arm-eabi/package.json').version
108
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
109
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
110
- }
111
- return binding
112
+ const binding = require("@xberg-io/crawlberg-android-arm-eabi");
113
+ const bindingPackageVersion = require("@xberg-io/crawlberg-android-arm-eabi/package.json").version;
114
+ if (
115
+ bindingPackageVersion !== require("./package.json").version &&
116
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
117
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
118
+ ) {
119
+ throw new Error(
120
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
121
+ );
122
+ }
123
+ return binding;
112
124
  } catch (e) {
113
- loadErrors.push(e)
125
+ loadErrors.push(e);
114
126
  }
115
127
  } else {
116
- loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
128
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
117
129
  }
118
- } else if (process.platform === 'win32') {
119
- if (process.arch === 'x64') {
120
- if ((process.config && process.config.variables && process.config.variables.shlib_suffix === 'dll.a') || (process.config && process.config.variables && process.config.variables.node_target_type === 'shared_library')) {
130
+ } else if (process.platform === "win32") {
131
+ if (process.arch === "x64") {
132
+ if (
133
+ (process.config && process.config.variables && process.config.variables.shlib_suffix === "dll.a") ||
134
+ (process.config && process.config.variables && process.config.variables.node_target_type === "shared_library")
135
+ ) {
121
136
  try {
122
- return require('./crawlberg-node.win32-x64-gnu.node')
137
+ return require("./crawlberg-node.win32-x64-gnu.node");
123
138
  } catch (e) {
124
- loadErrors.push(e)
139
+ loadErrors.push(e);
125
140
  }
126
141
  try {
127
- const binding = require('@xberg-io/crawlberg-win32-x64-gnu')
128
- const bindingPackageVersion = require('@xberg-io/crawlberg-win32-x64-gnu/package.json').version
129
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
130
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
142
+ const binding = require("@xberg-io/crawlberg-win32-x64-gnu");
143
+ const bindingPackageVersion = require("@xberg-io/crawlberg-win32-x64-gnu/package.json").version;
144
+ if (
145
+ bindingPackageVersion !== require("./package.json").version &&
146
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
147
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
148
+ ) {
149
+ throw new Error(
150
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
151
+ );
131
152
  }
132
- return binding
153
+ return binding;
133
154
  } catch (e) {
134
- loadErrors.push(e)
155
+ loadErrors.push(e);
135
156
  }
136
157
  } else {
137
158
  try {
138
- return require('./crawlberg-node.win32-x64-msvc.node')
159
+ return require("./crawlberg-node.win32-x64-msvc.node");
139
160
  } catch (e) {
140
- loadErrors.push(e)
161
+ loadErrors.push(e);
141
162
  }
142
163
  try {
143
- const binding = require('@xberg-io/crawlberg-win32-x64-msvc')
144
- const bindingPackageVersion = require('@xberg-io/crawlberg-win32-x64-msvc/package.json').version
145
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
146
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
164
+ const binding = require("@xberg-io/crawlberg-win32-x64-msvc");
165
+ const bindingPackageVersion = require("@xberg-io/crawlberg-win32-x64-msvc/package.json").version;
166
+ if (
167
+ bindingPackageVersion !== require("./package.json").version &&
168
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
169
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
170
+ ) {
171
+ throw new Error(
172
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
173
+ );
147
174
  }
148
- return binding
175
+ return binding;
149
176
  } catch (e) {
150
- loadErrors.push(e)
177
+ loadErrors.push(e);
151
178
  }
152
179
  }
153
- } else if (process.arch === 'ia32') {
180
+ } else if (process.arch === "ia32") {
154
181
  try {
155
- return require('./crawlberg-node.win32-ia32-msvc.node')
182
+ return require("./crawlberg-node.win32-ia32-msvc.node");
156
183
  } catch (e) {
157
- loadErrors.push(e)
184
+ loadErrors.push(e);
158
185
  }
159
186
  try {
160
- const binding = require('@xberg-io/crawlberg-win32-ia32-msvc')
161
- const bindingPackageVersion = require('@xberg-io/crawlberg-win32-ia32-msvc/package.json').version
162
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
163
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
164
- }
165
- return binding
187
+ const binding = require("@xberg-io/crawlberg-win32-ia32-msvc");
188
+ const bindingPackageVersion = require("@xberg-io/crawlberg-win32-ia32-msvc/package.json").version;
189
+ if (
190
+ bindingPackageVersion !== require("./package.json").version &&
191
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
192
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
193
+ ) {
194
+ throw new Error(
195
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
196
+ );
197
+ }
198
+ return binding;
166
199
  } catch (e) {
167
- loadErrors.push(e)
200
+ loadErrors.push(e);
168
201
  }
169
- } else if (process.arch === 'arm64') {
202
+ } else if (process.arch === "arm64") {
170
203
  try {
171
- return require('./crawlberg-node.win32-arm64-msvc.node')
204
+ return require("./crawlberg-node.win32-arm64-msvc.node");
172
205
  } catch (e) {
173
- loadErrors.push(e)
206
+ loadErrors.push(e);
174
207
  }
175
208
  try {
176
- const binding = require('@xberg-io/crawlberg-win32-arm64-msvc')
177
- const bindingPackageVersion = require('@xberg-io/crawlberg-win32-arm64-msvc/package.json').version
178
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
179
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
180
- }
181
- return binding
209
+ const binding = require("@xberg-io/crawlberg-win32-arm64-msvc");
210
+ const bindingPackageVersion = require("@xberg-io/crawlberg-win32-arm64-msvc/package.json").version;
211
+ if (
212
+ bindingPackageVersion !== require("./package.json").version &&
213
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
214
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
215
+ ) {
216
+ throw new Error(
217
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
218
+ );
219
+ }
220
+ return binding;
182
221
  } catch (e) {
183
- loadErrors.push(e)
222
+ loadErrors.push(e);
184
223
  }
185
224
  } else {
186
- loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
225
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
187
226
  }
188
- } else if (process.platform === 'darwin') {
227
+ } else if (process.platform === "darwin") {
189
228
  try {
190
- return require('./crawlberg-node.darwin-universal.node')
229
+ return require("./crawlberg-node.darwin-universal.node");
191
230
  } catch (e) {
192
- loadErrors.push(e)
231
+ loadErrors.push(e);
193
232
  }
194
233
  try {
195
- const binding = require('@xberg-io/crawlberg-darwin-universal')
196
- const bindingPackageVersion = require('@xberg-io/crawlberg-darwin-universal/package.json').version
197
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
198
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
199
- }
200
- return binding
234
+ const binding = require("@xberg-io/crawlberg-darwin-universal");
235
+ const bindingPackageVersion = require("@xberg-io/crawlberg-darwin-universal/package.json").version;
236
+ if (
237
+ bindingPackageVersion !== require("./package.json").version &&
238
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
239
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
240
+ ) {
241
+ throw new Error(
242
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
243
+ );
244
+ }
245
+ return binding;
201
246
  } catch (e) {
202
- loadErrors.push(e)
247
+ loadErrors.push(e);
203
248
  }
204
- if (process.arch === 'x64') {
249
+ if (process.arch === "x64") {
205
250
  try {
206
- return require('./crawlberg-node.darwin-x64.node')
251
+ return require("./crawlberg-node.darwin-x64.node");
207
252
  } catch (e) {
208
- loadErrors.push(e)
253
+ loadErrors.push(e);
209
254
  }
210
255
  try {
211
- const binding = require('@xberg-io/crawlberg-darwin-x64')
212
- const bindingPackageVersion = require('@xberg-io/crawlberg-darwin-x64/package.json').version
213
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
214
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
215
- }
216
- return binding
256
+ const binding = require("@xberg-io/crawlberg-darwin-x64");
257
+ const bindingPackageVersion = require("@xberg-io/crawlberg-darwin-x64/package.json").version;
258
+ if (
259
+ bindingPackageVersion !== require("./package.json").version &&
260
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
261
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
262
+ ) {
263
+ throw new Error(
264
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
265
+ );
266
+ }
267
+ return binding;
217
268
  } catch (e) {
218
- loadErrors.push(e)
269
+ loadErrors.push(e);
219
270
  }
220
- } else if (process.arch === 'arm64') {
271
+ } else if (process.arch === "arm64") {
221
272
  try {
222
- return require('./crawlberg-node.darwin-arm64.node')
273
+ return require("./crawlberg-node.darwin-arm64.node");
223
274
  } catch (e) {
224
- loadErrors.push(e)
275
+ loadErrors.push(e);
225
276
  }
226
277
  try {
227
- const binding = require('@xberg-io/crawlberg-darwin-arm64')
228
- const bindingPackageVersion = require('@xberg-io/crawlberg-darwin-arm64/package.json').version
229
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
230
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
231
- }
232
- return binding
278
+ const binding = require("@xberg-io/crawlberg-darwin-arm64");
279
+ const bindingPackageVersion = require("@xberg-io/crawlberg-darwin-arm64/package.json").version;
280
+ if (
281
+ bindingPackageVersion !== require("./package.json").version &&
282
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
283
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
284
+ ) {
285
+ throw new Error(
286
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
287
+ );
288
+ }
289
+ return binding;
233
290
  } catch (e) {
234
- loadErrors.push(e)
291
+ loadErrors.push(e);
235
292
  }
236
293
  } else {
237
- loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
294
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
238
295
  }
239
- } else if (process.platform === 'freebsd') {
240
- if (process.arch === 'x64') {
296
+ } else if (process.platform === "freebsd") {
297
+ if (process.arch === "x64") {
241
298
  try {
242
- return require('./crawlberg-node.freebsd-x64.node')
299
+ return require("./crawlberg-node.freebsd-x64.node");
243
300
  } catch (e) {
244
- loadErrors.push(e)
301
+ loadErrors.push(e);
245
302
  }
246
303
  try {
247
- const binding = require('@xberg-io/crawlberg-freebsd-x64')
248
- const bindingPackageVersion = require('@xberg-io/crawlberg-freebsd-x64/package.json').version
249
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
250
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
251
- }
252
- return binding
304
+ const binding = require("@xberg-io/crawlberg-freebsd-x64");
305
+ const bindingPackageVersion = require("@xberg-io/crawlberg-freebsd-x64/package.json").version;
306
+ if (
307
+ bindingPackageVersion !== require("./package.json").version &&
308
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
309
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
310
+ ) {
311
+ throw new Error(
312
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
313
+ );
314
+ }
315
+ return binding;
253
316
  } catch (e) {
254
- loadErrors.push(e)
317
+ loadErrors.push(e);
255
318
  }
256
- } else if (process.arch === 'arm64') {
319
+ } else if (process.arch === "arm64") {
257
320
  try {
258
- return require('./crawlberg-node.freebsd-arm64.node')
321
+ return require("./crawlberg-node.freebsd-arm64.node");
259
322
  } catch (e) {
260
- loadErrors.push(e)
323
+ loadErrors.push(e);
261
324
  }
262
325
  try {
263
- const binding = require('@xberg-io/crawlberg-freebsd-arm64')
264
- const bindingPackageVersion = require('@xberg-io/crawlberg-freebsd-arm64/package.json').version
265
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
266
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
267
- }
268
- return binding
326
+ const binding = require("@xberg-io/crawlberg-freebsd-arm64");
327
+ const bindingPackageVersion = require("@xberg-io/crawlberg-freebsd-arm64/package.json").version;
328
+ if (
329
+ bindingPackageVersion !== require("./package.json").version &&
330
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
331
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
332
+ ) {
333
+ throw new Error(
334
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
335
+ );
336
+ }
337
+ return binding;
269
338
  } catch (e) {
270
- loadErrors.push(e)
339
+ loadErrors.push(e);
271
340
  }
272
341
  } else {
273
- loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
342
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
274
343
  }
275
- } else if (process.platform === 'linux') {
276
- if (process.arch === 'x64') {
344
+ } else if (process.platform === "linux") {
345
+ if (process.arch === "x64") {
277
346
  if (isMusl()) {
278
347
  try {
279
- return require('./crawlberg-node.linux-x64-musl.node')
348
+ return require("./crawlberg-node.linux-x64-musl.node");
280
349
  } catch (e) {
281
- loadErrors.push(e)
350
+ loadErrors.push(e);
282
351
  }
283
352
  try {
284
- const binding = require('@xberg-io/crawlberg-linux-x64-musl')
285
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-x64-musl/package.json').version
286
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
287
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
353
+ const binding = require("@xberg-io/crawlberg-linux-x64-musl");
354
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-x64-musl/package.json").version;
355
+ if (
356
+ bindingPackageVersion !== require("./package.json").version &&
357
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
358
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
359
+ ) {
360
+ throw new Error(
361
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
362
+ );
288
363
  }
289
- return binding
364
+ return binding;
290
365
  } catch (e) {
291
- loadErrors.push(e)
366
+ loadErrors.push(e);
292
367
  }
293
368
  } else {
294
369
  try {
295
- return require('./crawlberg-node.linux-x64-gnu.node')
370
+ return require("./crawlberg-node.linux-x64-gnu.node");
296
371
  } catch (e) {
297
- loadErrors.push(e)
372
+ loadErrors.push(e);
298
373
  }
299
374
  try {
300
- const binding = require('@xberg-io/crawlberg-linux-x64-gnu')
301
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-x64-gnu/package.json').version
302
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
303
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
375
+ const binding = require("@xberg-io/crawlberg-linux-x64-gnu");
376
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-x64-gnu/package.json").version;
377
+ if (
378
+ bindingPackageVersion !== require("./package.json").version &&
379
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
380
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
381
+ ) {
382
+ throw new Error(
383
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
384
+ );
304
385
  }
305
- return binding
386
+ return binding;
306
387
  } catch (e) {
307
- loadErrors.push(e)
388
+ loadErrors.push(e);
308
389
  }
309
390
  }
310
- } else if (process.arch === 'arm64') {
391
+ } else if (process.arch === "arm64") {
311
392
  if (isMusl()) {
312
393
  try {
313
- return require('./crawlberg-node.linux-arm64-musl.node')
394
+ return require("./crawlberg-node.linux-arm64-musl.node");
314
395
  } catch (e) {
315
- loadErrors.push(e)
396
+ loadErrors.push(e);
316
397
  }
317
398
  try {
318
- const binding = require('@xberg-io/crawlberg-linux-arm64-musl')
319
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-arm64-musl/package.json').version
320
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
321
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
399
+ const binding = require("@xberg-io/crawlberg-linux-arm64-musl");
400
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-arm64-musl/package.json").version;
401
+ if (
402
+ bindingPackageVersion !== require("./package.json").version &&
403
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
404
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
405
+ ) {
406
+ throw new Error(
407
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
408
+ );
322
409
  }
323
- return binding
410
+ return binding;
324
411
  } catch (e) {
325
- loadErrors.push(e)
412
+ loadErrors.push(e);
326
413
  }
327
414
  } else {
328
415
  try {
329
- return require('./crawlberg-node.linux-arm64-gnu.node')
416
+ return require("./crawlberg-node.linux-arm64-gnu.node");
330
417
  } catch (e) {
331
- loadErrors.push(e)
418
+ loadErrors.push(e);
332
419
  }
333
420
  try {
334
- const binding = require('@xberg-io/crawlberg-linux-arm64-gnu')
335
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-arm64-gnu/package.json').version
336
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
337
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
421
+ const binding = require("@xberg-io/crawlberg-linux-arm64-gnu");
422
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-arm64-gnu/package.json").version;
423
+ if (
424
+ bindingPackageVersion !== require("./package.json").version &&
425
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
426
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
427
+ ) {
428
+ throw new Error(
429
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
430
+ );
338
431
  }
339
- return binding
432
+ return binding;
340
433
  } catch (e) {
341
- loadErrors.push(e)
434
+ loadErrors.push(e);
342
435
  }
343
436
  }
344
- } else if (process.arch === 'arm') {
437
+ } else if (process.arch === "arm") {
345
438
  if (isMusl()) {
346
439
  try {
347
- return require('./crawlberg-node.linux-arm-musleabihf.node')
440
+ return require("./crawlberg-node.linux-arm-musleabihf.node");
348
441
  } catch (e) {
349
- loadErrors.push(e)
442
+ loadErrors.push(e);
350
443
  }
351
444
  try {
352
- const binding = require('@xberg-io/crawlberg-linux-arm-musleabihf')
353
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-arm-musleabihf/package.json').version
354
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
355
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
+ const binding = require("@xberg-io/crawlberg-linux-arm-musleabihf");
446
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-arm-musleabihf/package.json").version;
447
+ if (
448
+ bindingPackageVersion !== require("./package.json").version &&
449
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
450
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
451
+ ) {
452
+ throw new Error(
453
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
454
+ );
356
455
  }
357
- return binding
456
+ return binding;
358
457
  } catch (e) {
359
- loadErrors.push(e)
458
+ loadErrors.push(e);
360
459
  }
361
460
  } else {
362
461
  try {
363
- return require('./crawlberg-node.linux-arm-gnueabihf.node')
462
+ return require("./crawlberg-node.linux-arm-gnueabihf.node");
364
463
  } catch (e) {
365
- loadErrors.push(e)
464
+ loadErrors.push(e);
366
465
  }
367
466
  try {
368
- const binding = require('@xberg-io/crawlberg-linux-arm-gnueabihf')
369
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-arm-gnueabihf/package.json').version
370
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
371
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
467
+ const binding = require("@xberg-io/crawlberg-linux-arm-gnueabihf");
468
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-arm-gnueabihf/package.json").version;
469
+ if (
470
+ bindingPackageVersion !== require("./package.json").version &&
471
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
472
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
473
+ ) {
474
+ throw new Error(
475
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
476
+ );
372
477
  }
373
- return binding
478
+ return binding;
374
479
  } catch (e) {
375
- loadErrors.push(e)
480
+ loadErrors.push(e);
376
481
  }
377
482
  }
378
- } else if (process.arch === 'loong64') {
483
+ } else if (process.arch === "loong64") {
379
484
  if (isMusl()) {
380
485
  try {
381
- return require('./crawlberg-node.linux-loong64-musl.node')
486
+ return require("./crawlberg-node.linux-loong64-musl.node");
382
487
  } catch (e) {
383
- loadErrors.push(e)
488
+ loadErrors.push(e);
384
489
  }
385
490
  try {
386
- const binding = require('@xberg-io/crawlberg-linux-loong64-musl')
387
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-loong64-musl/package.json').version
388
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
389
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
491
+ const binding = require("@xberg-io/crawlberg-linux-loong64-musl");
492
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-loong64-musl/package.json").version;
493
+ if (
494
+ bindingPackageVersion !== require("./package.json").version &&
495
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
496
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
497
+ ) {
498
+ throw new Error(
499
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
500
+ );
390
501
  }
391
- return binding
502
+ return binding;
392
503
  } catch (e) {
393
- loadErrors.push(e)
504
+ loadErrors.push(e);
394
505
  }
395
506
  } else {
396
507
  try {
397
- return require('./crawlberg-node.linux-loong64-gnu.node')
508
+ return require("./crawlberg-node.linux-loong64-gnu.node");
398
509
  } catch (e) {
399
- loadErrors.push(e)
510
+ loadErrors.push(e);
400
511
  }
401
512
  try {
402
- const binding = require('@xberg-io/crawlberg-linux-loong64-gnu')
403
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-loong64-gnu/package.json').version
404
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
405
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
+ const binding = require("@xberg-io/crawlberg-linux-loong64-gnu");
514
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-loong64-gnu/package.json").version;
515
+ if (
516
+ bindingPackageVersion !== require("./package.json").version &&
517
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
518
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
519
+ ) {
520
+ throw new Error(
521
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
522
+ );
406
523
  }
407
- return binding
524
+ return binding;
408
525
  } catch (e) {
409
- loadErrors.push(e)
526
+ loadErrors.push(e);
410
527
  }
411
528
  }
412
- } else if (process.arch === 'riscv64') {
529
+ } else if (process.arch === "riscv64") {
413
530
  if (isMusl()) {
414
531
  try {
415
- return require('./crawlberg-node.linux-riscv64-musl.node')
532
+ return require("./crawlberg-node.linux-riscv64-musl.node");
416
533
  } catch (e) {
417
- loadErrors.push(e)
534
+ loadErrors.push(e);
418
535
  }
419
536
  try {
420
- const binding = require('@xberg-io/crawlberg-linux-riscv64-musl')
421
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-riscv64-musl/package.json').version
422
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
423
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
537
+ const binding = require("@xberg-io/crawlberg-linux-riscv64-musl");
538
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-riscv64-musl/package.json").version;
539
+ if (
540
+ bindingPackageVersion !== require("./package.json").version &&
541
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
542
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
543
+ ) {
544
+ throw new Error(
545
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
546
+ );
424
547
  }
425
- return binding
548
+ return binding;
426
549
  } catch (e) {
427
- loadErrors.push(e)
550
+ loadErrors.push(e);
428
551
  }
429
552
  } else {
430
553
  try {
431
- return require('./crawlberg-node.linux-riscv64-gnu.node')
554
+ return require("./crawlberg-node.linux-riscv64-gnu.node");
432
555
  } catch (e) {
433
- loadErrors.push(e)
556
+ loadErrors.push(e);
434
557
  }
435
558
  try {
436
- const binding = require('@xberg-io/crawlberg-linux-riscv64-gnu')
437
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-riscv64-gnu/package.json').version
438
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
439
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
559
+ const binding = require("@xberg-io/crawlberg-linux-riscv64-gnu");
560
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-riscv64-gnu/package.json").version;
561
+ if (
562
+ bindingPackageVersion !== require("./package.json").version &&
563
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
564
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
565
+ ) {
566
+ throw new Error(
567
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
568
+ );
440
569
  }
441
- return binding
570
+ return binding;
442
571
  } catch (e) {
443
- loadErrors.push(e)
572
+ loadErrors.push(e);
444
573
  }
445
574
  }
446
- } else if (process.arch === 'ppc64') {
575
+ } else if (process.arch === "ppc64") {
447
576
  try {
448
- return require('./crawlberg-node.linux-ppc64-gnu.node')
577
+ return require("./crawlberg-node.linux-ppc64-gnu.node");
449
578
  } catch (e) {
450
- loadErrors.push(e)
579
+ loadErrors.push(e);
451
580
  }
452
581
  try {
453
- const binding = require('@xberg-io/crawlberg-linux-ppc64-gnu')
454
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-ppc64-gnu/package.json').version
455
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
456
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
457
- }
458
- return binding
582
+ const binding = require("@xberg-io/crawlberg-linux-ppc64-gnu");
583
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-ppc64-gnu/package.json").version;
584
+ if (
585
+ bindingPackageVersion !== require("./package.json").version &&
586
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
587
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
588
+ ) {
589
+ throw new Error(
590
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
591
+ );
592
+ }
593
+ return binding;
459
594
  } catch (e) {
460
- loadErrors.push(e)
595
+ loadErrors.push(e);
461
596
  }
462
- } else if (process.arch === 's390x') {
597
+ } else if (process.arch === "s390x") {
463
598
  try {
464
- return require('./crawlberg-node.linux-s390x-gnu.node')
599
+ return require("./crawlberg-node.linux-s390x-gnu.node");
465
600
  } catch (e) {
466
- loadErrors.push(e)
601
+ loadErrors.push(e);
467
602
  }
468
603
  try {
469
- const binding = require('@xberg-io/crawlberg-linux-s390x-gnu')
470
- const bindingPackageVersion = require('@xberg-io/crawlberg-linux-s390x-gnu/package.json').version
471
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
472
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
473
- }
474
- return binding
604
+ const binding = require("@xberg-io/crawlberg-linux-s390x-gnu");
605
+ const bindingPackageVersion = require("@xberg-io/crawlberg-linux-s390x-gnu/package.json").version;
606
+ if (
607
+ bindingPackageVersion !== require("./package.json").version &&
608
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
609
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
610
+ ) {
611
+ throw new Error(
612
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
613
+ );
614
+ }
615
+ return binding;
475
616
  } catch (e) {
476
- loadErrors.push(e)
617
+ loadErrors.push(e);
477
618
  }
478
619
  } else {
479
- loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
620
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
480
621
  }
481
- } else if (process.platform === 'openharmony') {
482
- if (process.arch === 'arm64') {
622
+ } else if (process.platform === "openharmony") {
623
+ if (process.arch === "arm64") {
483
624
  try {
484
- return require('./crawlberg-node.openharmony-arm64.node')
625
+ return require("./crawlberg-node.openharmony-arm64.node");
485
626
  } catch (e) {
486
- loadErrors.push(e)
627
+ loadErrors.push(e);
487
628
  }
488
629
  try {
489
- const binding = require('@xberg-io/crawlberg-openharmony-arm64')
490
- const bindingPackageVersion = require('@xberg-io/crawlberg-openharmony-arm64/package.json').version
491
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
492
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
493
- }
494
- return binding
630
+ const binding = require("@xberg-io/crawlberg-openharmony-arm64");
631
+ const bindingPackageVersion = require("@xberg-io/crawlberg-openharmony-arm64/package.json").version;
632
+ if (
633
+ bindingPackageVersion !== require("./package.json").version &&
634
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
635
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
636
+ ) {
637
+ throw new Error(
638
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
639
+ );
640
+ }
641
+ return binding;
495
642
  } catch (e) {
496
- loadErrors.push(e)
643
+ loadErrors.push(e);
497
644
  }
498
- } else if (process.arch === 'x64') {
645
+ } else if (process.arch === "x64") {
499
646
  try {
500
- return require('./crawlberg-node.openharmony-x64.node')
647
+ return require("./crawlberg-node.openharmony-x64.node");
501
648
  } catch (e) {
502
- loadErrors.push(e)
649
+ loadErrors.push(e);
503
650
  }
504
651
  try {
505
- const binding = require('@xberg-io/crawlberg-openharmony-x64')
506
- const bindingPackageVersion = require('@xberg-io/crawlberg-openharmony-x64/package.json').version
507
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
508
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
509
- }
510
- return binding
652
+ const binding = require("@xberg-io/crawlberg-openharmony-x64");
653
+ const bindingPackageVersion = require("@xberg-io/crawlberg-openharmony-x64/package.json").version;
654
+ if (
655
+ bindingPackageVersion !== require("./package.json").version &&
656
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
657
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
658
+ ) {
659
+ throw new Error(
660
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
661
+ );
662
+ }
663
+ return binding;
511
664
  } catch (e) {
512
- loadErrors.push(e)
665
+ loadErrors.push(e);
513
666
  }
514
- } else if (process.arch === 'arm') {
667
+ } else if (process.arch === "arm") {
515
668
  try {
516
- return require('./crawlberg-node.openharmony-arm.node')
669
+ return require("./crawlberg-node.openharmony-arm.node");
517
670
  } catch (e) {
518
- loadErrors.push(e)
671
+ loadErrors.push(e);
519
672
  }
520
673
  try {
521
- const binding = require('@xberg-io/crawlberg-openharmony-arm')
522
- const bindingPackageVersion = require('@xberg-io/crawlberg-openharmony-arm/package.json').version
523
- if (bindingPackageVersion !== '1.11.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
524
- throw new Error(`Native binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
525
- }
526
- return binding
674
+ const binding = require("@xberg-io/crawlberg-openharmony-arm");
675
+ const bindingPackageVersion = require("@xberg-io/crawlberg-openharmony-arm/package.json").version;
676
+ if (
677
+ bindingPackageVersion !== require("./package.json").version &&
678
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
679
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
680
+ ) {
681
+ throw new Error(
682
+ `Native binding package version mismatch, expected ${require("./package.json").version} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
683
+ );
684
+ }
685
+ return binding;
527
686
  } catch (e) {
528
- loadErrors.push(e)
687
+ loadErrors.push(e);
529
688
  }
530
689
  } else {
531
- loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
690
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
532
691
  }
533
692
  } else {
534
- loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
693
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
535
694
  }
536
695
  }
537
696
 
538
697
  function createLoadErrorChain(errors) {
539
698
  return errors.reduce((previous, current) => {
540
- let message
699
+ let message;
541
700
  try {
542
- message =
543
- current && typeof current.message === 'string'
544
- ? current.message
545
- : String(current)
701
+ message = current && typeof current.message === "string" ? current.message : String(current);
546
702
  } catch {
547
- message = 'Unknown error'
703
+ message = "Unknown error";
548
704
  }
549
- const error = new Error(message)
550
- error.cause = previous
551
- return error
552
- }, null)
705
+ const error = new Error(message);
706
+ error.cause = previous;
707
+ return error;
708
+ }, null);
553
709
  }
554
710
 
555
711
  // NAPI_RS_FORCE_WASI is a tri-state flag:
@@ -562,139 +718,129 @@ function createLoadErrorChain(errors) {
562
718
  //
563
719
  // NAPI_RS_WASI_FLAVOR selects one exact generated flavor and implies strict
564
720
  // WASI loading. It never crosses into another flavor or falls back to native.
565
- const __napiWasiFlavors = ['wasm32-wasi']
566
- const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR
567
- const __napiWasiFlavorRequested =
568
- typeof __napiWasiFlavor === 'string' && __napiWasiFlavor.length > 0
569
- if (
570
- __napiWasiFlavorRequested &&
571
- __napiWasiFlavors.indexOf(__napiWasiFlavor) === -1
572
- ) {
721
+ const __napiWasiFlavors = ["wasm32-wasi"];
722
+ const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR;
723
+ const __napiWasiFlavorRequested = typeof __napiWasiFlavor === "string" && __napiWasiFlavor.length > 0;
724
+ if (__napiWasiFlavorRequested && __napiWasiFlavors.indexOf(__napiWasiFlavor) === -1) {
573
725
  throw new Error(
574
- 'Unsupported WASI flavor "' +
575
- __napiWasiFlavor +
576
- '". Available flavors: ' +
577
- __napiWasiFlavors.join(', '),
578
- )
726
+ 'Unsupported WASI flavor "' + __napiWasiFlavor + '". Available flavors: ' + __napiWasiFlavors.join(", "),
727
+ );
579
728
  }
580
- const forceWasiError = process.env.NAPI_RS_FORCE_WASI === 'error'
581
- const forceWasi =
582
- process.env.NAPI_RS_FORCE_WASI === 'true' ||
583
- forceWasiError ||
584
- __napiWasiFlavorRequested
729
+ const forceWasiError = process.env.NAPI_RS_FORCE_WASI === "error";
730
+ const forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || forceWasiError || __napiWasiFlavorRequested;
585
731
 
586
732
  if (!forceWasi) {
587
- nativeBinding = requireNative()
733
+ nativeBinding = requireNative();
588
734
  }
589
735
 
590
736
  if (!nativeBinding || forceWasi) {
591
- let wasiBinding = null
592
- let wasiBindingLoaded = false
593
- const wasiBindingErrors = []
737
+ let wasiBinding = null;
738
+ let wasiBindingLoaded = false;
739
+ const wasiBindingErrors = [];
594
740
  const __napiWasiResolveCandidate = (specifier, isPackage, localArtifacts) => {
595
741
  try {
596
- require.resolve(specifier)
742
+ require.resolve(specifier);
597
743
  } catch (resolveError) {
598
- if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
599
- throw resolveError
744
+ if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") {
745
+ throw resolveError;
600
746
  }
601
747
  if (isPackage) {
602
748
  try {
603
- require.resolve(specifier + '/package.json')
749
+ require.resolve(specifier + "/package.json");
604
750
  } catch (packageError) {
605
- if (packageError && packageError.code === 'MODULE_NOT_FOUND') {
606
- return resolveError
751
+ if (packageError && packageError.code === "MODULE_NOT_FOUND") {
752
+ return resolveError;
607
753
  }
608
754
  // An exports restriction proves the package exists even when its
609
755
  // package.json is not public. Preserve the root resolution failure.
610
- throw resolveError
756
+ throw resolveError;
611
757
  }
612
758
  // The package exists but its main/export target is broken.
613
- throw resolveError
759
+ throw resolveError;
614
760
  }
615
- return resolveError
761
+ return resolveError;
616
762
  }
617
763
  if (localArtifacts) {
618
- let artifactError = null
764
+ let artifactError = null;
619
765
  for (let i = 0; i < localArtifacts.length; i++) {
620
766
  try {
621
- require.resolve(localArtifacts[i])
622
- return null
767
+ require.resolve(localArtifacts[i]);
768
+ return null;
623
769
  } catch (resolveError) {
624
- if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
625
- throw resolveError
770
+ if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") {
771
+ throw resolveError;
626
772
  }
627
- artifactError = resolveError
773
+ artifactError = resolveError;
628
774
  }
629
775
  }
630
- return artifactError
776
+ return artifactError;
631
777
  }
632
- return null
633
- }
634
- if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
635
- let candidateError = null
636
- let candidateFailed = false
778
+ return null;
779
+ };
780
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
781
+ let candidateError = null;
782
+ let candidateFailed = false;
637
783
  try {
638
- candidateError = __napiWasiResolveCandidate('./crawlberg-node.wasi.cjs', false, ['./crawlberg-node.wasm32-wasi.debug.wasm', './crawlberg-node.wasm32-wasi.wasm'])
639
- candidateFailed = candidateError !== null
784
+ candidateError = __napiWasiResolveCandidate("./crawlberg-node.wasi.cjs", false, [
785
+ "./crawlberg-node.wasm32-wasi.debug.wasm",
786
+ "./crawlberg-node.wasm32-wasi.wasm",
787
+ ]);
788
+ candidateFailed = candidateError !== null;
640
789
  if (!candidateFailed) {
641
- wasiBinding = require('./crawlberg-node.wasi.cjs')
642
- nativeBinding = wasiBinding
643
- __napiLoadedBindingTarget = 'wasm32-wasi'
644
- wasiBindingLoaded = true
790
+ wasiBinding = require("./crawlberg-node.wasi.cjs");
791
+ nativeBinding = wasiBinding;
792
+ __napiLoadedBindingTarget = "wasm32-wasi";
793
+ wasiBindingLoaded = true;
645
794
  }
646
795
  } catch (err) {
647
- candidateError = err
648
- candidateFailed = true
796
+ candidateError = err;
797
+ candidateFailed = true;
649
798
  }
650
799
  if (candidateFailed) {
651
- wasiBindingErrors.push(candidateError)
652
- loadErrors.push(candidateError)
800
+ wasiBindingErrors.push(candidateError);
801
+ loadErrors.push(candidateError);
653
802
  }
654
803
  }
655
- if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
656
- let candidateError = null
657
- let candidateFailed = false
804
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
805
+ let candidateError = null;
806
+ let candidateFailed = false;
658
807
  try {
659
- candidateError = __napiWasiResolveCandidate('@xberg-io/crawlberg-wasm32-wasi', true, undefined)
660
- candidateFailed = candidateError !== null
808
+ candidateError = __napiWasiResolveCandidate("@xberg-io/crawlberg-wasm32-wasi", true, undefined);
809
+ candidateFailed = candidateError !== null;
661
810
  if (!candidateFailed) {
662
- if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
663
- const bindingPackageVersion = require('@xberg-io/crawlberg-wasm32-wasi/package.json').version
664
- if (bindingPackageVersion !== '1.11.1') {
665
- throw new Error(`WASI binding package version mismatch, expected 1.11.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
811
+ if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
812
+ const bindingPackageVersion = require("@xberg-io/crawlberg-wasm32-wasi/package.json").version;
813
+ if (bindingPackageVersion !== require("./package.json").version) {
814
+ throw new Error(
815
+ `WASI binding package version mismatch, expected 1.11.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
816
+ );
666
817
  }
667
818
  }
668
- wasiBinding = require('@xberg-io/crawlberg-wasm32-wasi')
669
- nativeBinding = wasiBinding
670
- __napiLoadedBindingTarget = 'wasm32-wasi'
671
- wasiBindingLoaded = true
819
+ wasiBinding = require("@xberg-io/crawlberg-wasm32-wasi");
820
+ nativeBinding = wasiBinding;
821
+ __napiLoadedBindingTarget = "wasm32-wasi";
822
+ wasiBindingLoaded = true;
672
823
  }
673
824
  } catch (err) {
674
- candidateError = err
675
- candidateFailed = true
825
+ candidateError = err;
826
+ candidateFailed = true;
676
827
  }
677
828
  if (candidateFailed) {
678
- wasiBindingErrors.push(candidateError)
679
- loadErrors.push(candidateError)
829
+ wasiBindingErrors.push(candidateError);
830
+ loadErrors.push(candidateError);
680
831
  }
681
832
  }
682
- if (
683
- !wasiBindingLoaded &&
684
- forceWasi &&
685
- !forceWasiError &&
686
- !__napiWasiFlavorRequested
687
- ) {
688
- nativeBinding = requireNative()
833
+ if (!wasiBindingLoaded && forceWasi && !forceWasiError && !__napiWasiFlavorRequested) {
834
+ nativeBinding = requireNative();
689
835
  }
690
836
  if ((forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
691
837
  const error = new Error(
692
838
  __napiWasiFlavorRequested
693
839
  ? 'WASI binding for flavor "' + __napiWasiFlavor + '" not found'
694
- : 'WASI binding not found and NAPI_RS_FORCE_WASI is set to error',
695
- )
696
- error.cause = createLoadErrorChain(wasiBindingErrors)
697
- throw error
840
+ : "WASI binding not found and NAPI_RS_FORCE_WASI is set to error",
841
+ );
842
+ error.cause = createLoadErrorChain(wasiBindingErrors);
843
+ throw error;
698
844
  }
699
845
  }
700
846
 
@@ -703,31 +849,29 @@ if (!nativeBinding) {
703
849
  const error = new Error(
704
850
  `Cannot find native binding. ` +
705
851
  `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
706
- 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
707
- )
852
+ "Please try `npm i` again after removing both package-lock.json and node_modules directory.",
853
+ );
708
854
  // assign instead of the `new Error(message, { cause })` options form,
709
855
  // which Node < 16.9 silently ignores
710
- error.cause = createLoadErrorChain(loadErrors)
711
- throw error
856
+ error.cause = createLoadErrorChain(loadErrors);
857
+ throw error;
712
858
  }
713
- throw new Error(`Failed to load native binding`)
859
+ throw new Error(`Failed to load native binding`);
714
860
  }
715
861
 
716
862
  function __napiStampBindingTarget(exportsObject, target) {
717
- if (
718
- Object.prototype.hasOwnProperty.call(exportsObject, '__napiBindingTarget')
719
- ) {
863
+ if (Object.prototype.hasOwnProperty.call(exportsObject, "__napiBindingTarget")) {
720
864
  if (exportsObject.__napiBindingTarget === target) {
721
865
  // Already ours: the root entry aliases the object it loaded, so a WASI
722
866
  // fallback candidate — or a `NAPI_RS_NATIVE_LIBRARY_PATH` override that
723
867
  // is a generated loader — arrives already stamped with this same value.
724
- return target
868
+ return target;
725
869
  }
726
870
  const error = new Error(
727
871
  '`__napiBindingTarget` is reserved by the generated binding loader, but the loaded binding already exports it. Rename the export, e.g. #[napi(js_name = "...")].',
728
- )
729
- error.code = 'ERR_NAPI_BINDING_TARGET_CONFLICT'
730
- throw error
872
+ );
873
+ error.code = "ERR_NAPI_BINDING_TARGET_CONFLICT";
874
+ throw error;
731
875
  }
732
876
  if (!Object.isExtensible(exportsObject)) {
733
877
  // A `#[napi(module_exports)]` hook may seal or freeze this object
@@ -737,19 +881,19 @@ function __napiStampBindingTarget(exportsObject, target) {
737
881
  // browser and deferred loaders declare `__napiBindingTarget` at module
738
882
  // level and go on reporting it, while the CommonJS entries hand back this
739
883
  // very object as `module.exports`, so there the value is absent.
740
- return target
884
+ return target;
741
885
  }
742
886
  try {
743
887
  // [[Define]], not [[Set]]: an ordinary assignment walks the prototype
744
888
  // chain, so an inherited accessor could swallow the value or throw and
745
889
  // fail an otherwise successful load. The descriptor is what a successful
746
890
  // assignment would have produced.
747
- Object.defineProperty(exportsObject, '__napiBindingTarget', {
891
+ Object.defineProperty(exportsObject, "__napiBindingTarget", {
748
892
  configurable: true,
749
893
  enumerable: true,
750
894
  value: target,
751
895
  writable: true,
752
- })
896
+ });
753
897
  } catch {
754
898
  // Same rule as the non-extensible skip above: reporting the artifact is
755
899
  // metadata, never a reason to fail an otherwise successful load. An exotic
@@ -759,7 +903,7 @@ function __napiStampBindingTarget(exportsObject, target) {
759
903
  // The CommonJS loaders assign this return value so `cjs-module-lexer` — and
760
904
  // therefore Node's CJS -> ESM named export detection — can see
761
905
  // `__napiBindingTarget` statically.
762
- return target
906
+ return target;
763
907
  }
764
908
  // Stamp before the alias, not after. The guard only reads `nativeBinding`
765
909
  // (`hasOwnProperty` plus a comparison), which is safe against any addon
@@ -776,46 +920,48 @@ function __napiStampBindingTarget(exportsObject, target) {
776
920
  // discards the value it wrote. What a consumer reads is whatever the guard put
777
921
  // on `nativeBinding`, so on a frozen binding, where the guard skips, the
778
922
  // linked import resolves to `undefined`.
779
- module.exports.__napiBindingTarget = __napiStampBindingTarget(nativeBinding, __napiLoadedBindingTarget)
780
- module.exports = nativeBinding
781
- module.exports.BatchCrawlStreamIterator = nativeBinding.BatchCrawlStreamIterator
782
- module.exports.CrawlEngineHandle = nativeBinding.CrawlEngineHandle
783
- module.exports.JsCrawlEngineHandle = nativeBinding.JsCrawlEngineHandle
784
- module.exports.CrawlStreamIterator = nativeBinding.CrawlStreamIterator
785
- module.exports.AssetCategory = nativeBinding.AssetCategory
786
- module.exports.JsAssetCategory = nativeBinding.JsAssetCategory
787
- module.exports.batchCrawl = nativeBinding.batchCrawl
788
- module.exports.batchCrawlStream = nativeBinding.batchCrawlStream
789
- module.exports.batchScrape = nativeBinding.batchScrape
790
- module.exports.BrowserBackend = nativeBinding.BrowserBackend
791
- module.exports.JsBrowserBackend = nativeBinding.JsBrowserBackend
792
- module.exports.browserConfigDefault = nativeBinding.browserConfigDefault
793
- module.exports.BrowserMode = nativeBinding.BrowserMode
794
- module.exports.JsBrowserMode = nativeBinding.JsBrowserMode
795
- module.exports.BrowserWait = nativeBinding.BrowserWait
796
- module.exports.JsBrowserWait = nativeBinding.JsBrowserWait
797
- module.exports.contentConfigDefault = nativeBinding.contentConfigDefault
798
- module.exports.ContentFilterKind = nativeBinding.ContentFilterKind
799
- module.exports.JsContentFilterKind = nativeBinding.JsContentFilterKind
800
- module.exports.crawl = nativeBinding.crawl
801
- module.exports.crawlConfigDefault = nativeBinding.crawlConfigDefault
802
- module.exports.CrawlStrategyKind = nativeBinding.CrawlStrategyKind
803
- module.exports.JsCrawlStrategyKind = nativeBinding.JsCrawlStrategyKind
804
- module.exports.crawlStream = nativeBinding.crawlStream
805
- module.exports.createEngine = nativeBinding.createEngine
806
- module.exports.DocumentContentEncoding = nativeBinding.DocumentContentEncoding
807
- module.exports.JsDocumentContentEncoding = nativeBinding.JsDocumentContentEncoding
808
- module.exports.FeedType = nativeBinding.FeedType
809
- module.exports.JsFeedType = nativeBinding.JsFeedType
810
- module.exports.generateCitations = nativeBinding.generateCitations
811
- module.exports.ImageSource = nativeBinding.ImageSource
812
- module.exports.JsImageSource = nativeBinding.JsImageSource
813
- module.exports.interact = nativeBinding.interact
814
- module.exports.LinkType = nativeBinding.LinkType
815
- module.exports.JsLinkType = nativeBinding.JsLinkType
816
- module.exports.mapUrls = nativeBinding.mapUrls
817
- module.exports.scrape = nativeBinding.scrape
818
- module.exports.ScrollDirection = nativeBinding.ScrollDirection
819
- module.exports.JsScrollDirection = nativeBinding.JsScrollDirection
820
- module.exports.ssrfPolicyDefault = nativeBinding.ssrfPolicyDefault
821
- module.exports.ssrfPolicyFromEnv = nativeBinding.ssrfPolicyFromEnv
923
+ module.exports.__napiBindingTarget = __napiStampBindingTarget(nativeBinding, __napiLoadedBindingTarget);
924
+ module.exports = nativeBinding;
925
+ module.exports.BatchCrawlStreamIterator = nativeBinding.BatchCrawlStreamIterator;
926
+ module.exports.CrawlEngineHandle = nativeBinding.CrawlEngineHandle;
927
+ module.exports.JsCrawlEngineHandle = nativeBinding.JsCrawlEngineHandle;
928
+ module.exports.CrawlStreamIterator = nativeBinding.CrawlStreamIterator;
929
+ module.exports.AssetCategory = nativeBinding.AssetCategory;
930
+ module.exports.JsAssetCategory = nativeBinding.JsAssetCategory;
931
+ module.exports.batchCrawl = nativeBinding.batchCrawl;
932
+ module.exports.batchCrawlStream = nativeBinding.batchCrawlStream;
933
+ module.exports.batchScrape = nativeBinding.batchScrape;
934
+ module.exports.BrowserBackend = nativeBinding.BrowserBackend;
935
+ module.exports.JsBrowserBackend = nativeBinding.JsBrowserBackend;
936
+ module.exports.browserConfigDefault = nativeBinding.browserConfigDefault;
937
+ module.exports.BrowserMode = nativeBinding.BrowserMode;
938
+ module.exports.JsBrowserMode = nativeBinding.JsBrowserMode;
939
+ module.exports.BrowserWait = nativeBinding.BrowserWait;
940
+ module.exports.JsBrowserWait = nativeBinding.JsBrowserWait;
941
+ module.exports.contentConfigDefault = nativeBinding.contentConfigDefault;
942
+ module.exports.ContentFilterKind = nativeBinding.ContentFilterKind;
943
+ module.exports.JsContentFilterKind = nativeBinding.JsContentFilterKind;
944
+ module.exports.crawl = nativeBinding.crawl;
945
+ module.exports.crawlConfigDefault = nativeBinding.crawlConfigDefault;
946
+ module.exports.CrawlStrategyKind = nativeBinding.CrawlStrategyKind;
947
+ module.exports.JsCrawlStrategyKind = nativeBinding.JsCrawlStrategyKind;
948
+ module.exports.crawlStream = nativeBinding.crawlStream;
949
+ module.exports.createEngine = nativeBinding.createEngine;
950
+ module.exports.DocumentContentEncoding = nativeBinding.DocumentContentEncoding;
951
+ module.exports.JsDocumentContentEncoding = nativeBinding.JsDocumentContentEncoding;
952
+ module.exports.FeedType = nativeBinding.FeedType;
953
+ module.exports.JsFeedType = nativeBinding.JsFeedType;
954
+ module.exports.generateCitations = nativeBinding.generateCitations;
955
+ module.exports.ImageSource = nativeBinding.ImageSource;
956
+ module.exports.JsImageSource = nativeBinding.JsImageSource;
957
+ module.exports.interact = nativeBinding.interact;
958
+ module.exports.LinkType = nativeBinding.LinkType;
959
+ module.exports.JsLinkType = nativeBinding.JsLinkType;
960
+ module.exports.mapUrls = nativeBinding.mapUrls;
961
+ module.exports.scrape = nativeBinding.scrape;
962
+ module.exports.ScrollDirection = nativeBinding.ScrollDirection;
963
+ module.exports.JsScrollDirection = nativeBinding.JsScrollDirection;
964
+ module.exports.ssrfPolicyDefault = nativeBinding.ssrfPolicyDefault;
965
+ module.exports.ssrfPolicyFromEnv = nativeBinding.ssrfPolicyFromEnv;
966
+
967
+ module.exports = require("./binding.cjs")(nativeBinding);