@kreuzberg/html-to-markdown-node 3.4.0-rc.8 → 3.4.0
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/index.d.ts +12 -4
- package/index.js +520 -330
- package/package.json +29 -50
package/index.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export declare class JsConversionOptionsBuilder {
|
|
|
9
9
|
build(): JsConversionOptions
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
export declare class JsVisitorHandle {
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare function convert(html: string, options?: JsConversionOptions | undefined | null): JsConversionResult
|
|
17
|
+
|
|
12
18
|
export interface JsAnnotationKind {
|
|
13
19
|
annotation_type: string
|
|
14
20
|
url?: string
|
|
@@ -62,6 +68,7 @@ export interface JsConversionOptions {
|
|
|
62
68
|
inferDimensions?: boolean
|
|
63
69
|
maxDepth?: number
|
|
64
70
|
excludeSelectors?: Array<string>
|
|
71
|
+
visitor?: object
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
export interface JsConversionOptionsUpdate {
|
|
@@ -105,6 +112,7 @@ export interface JsConversionOptionsUpdate {
|
|
|
105
112
|
inferDimensions?: boolean
|
|
106
113
|
maxDepth?: number
|
|
107
114
|
excludeSelectors?: Array<string>
|
|
115
|
+
visitor?: object
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
export interface JsConversionResult {
|
|
@@ -392,7 +400,7 @@ export interface JsStructuredData {
|
|
|
392
400
|
export declare const enum JsStructuredDataType {
|
|
393
401
|
JsonLd = 'json_ld',
|
|
394
402
|
Microdata = 'microdata',
|
|
395
|
-
RDFa = '
|
|
403
|
+
RDFa = 'rdfa'
|
|
396
404
|
}
|
|
397
405
|
|
|
398
406
|
export interface JsTableData {
|
|
@@ -413,9 +421,9 @@ export interface JsTextAnnotation {
|
|
|
413
421
|
}
|
|
414
422
|
|
|
415
423
|
export declare const enum JsTextDirection {
|
|
416
|
-
LeftToRight = '
|
|
417
|
-
RightToLeft = '
|
|
418
|
-
Auto = '
|
|
424
|
+
LeftToRight = 'ltr',
|
|
425
|
+
RightToLeft = 'rtl',
|
|
426
|
+
Auto = 'auto'
|
|
419
427
|
}
|
|
420
428
|
|
|
421
429
|
export declare const enum JsVisitResult {
|
package/index.js
CHANGED
|
@@ -4,557 +4,746 @@
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
6
|
const { readFileSync } = require('node:fs')
|
|
7
|
-
let nativeBinding = null
|
|
8
|
-
const loadErrors = []
|
|
7
|
+
let nativeBinding = null;
|
|
8
|
+
const loadErrors = [];
|
|
9
9
|
|
|
10
10
|
const isMusl = () => {
|
|
11
|
-
let musl = false
|
|
12
|
-
if (process.platform ===
|
|
13
|
-
musl = isMuslFromFilesystem()
|
|
11
|
+
let musl = false;
|
|
12
|
+
if (process.platform === "linux") {
|
|
13
|
+
musl = isMuslFromFilesystem();
|
|
14
14
|
if (musl === null) {
|
|
15
|
-
musl = isMuslFromReport()
|
|
15
|
+
musl = isMuslFromReport();
|
|
16
16
|
}
|
|
17
17
|
if (musl === null) {
|
|
18
|
-
musl = isMuslFromChildProcess()
|
|
18
|
+
musl = isMuslFromChildProcess();
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
return musl
|
|
22
|
-
}
|
|
21
|
+
return musl;
|
|
22
|
+
};
|
|
23
23
|
|
|
24
|
-
const isFileMusl = (f) => f.includes(
|
|
24
|
+
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
25
25
|
|
|
26
26
|
const isMuslFromFilesystem = () => {
|
|
27
27
|
try {
|
|
28
|
-
return readFileSync(
|
|
28
|
+
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
|
|
29
29
|
} catch {
|
|
30
|
-
return null
|
|
30
|
+
return null;
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
33
|
|
|
34
34
|
const isMuslFromReport = () => {
|
|
35
|
-
let report = null
|
|
36
|
-
if (typeof process.report?.getReport ===
|
|
37
|
-
process.report.excludeNetwork = true
|
|
38
|
-
report = process.report.getReport()
|
|
35
|
+
let report = null;
|
|
36
|
+
if (typeof process.report?.getReport === "function") {
|
|
37
|
+
process.report.excludeNetwork = true;
|
|
38
|
+
report = process.report.getReport();
|
|
39
39
|
}
|
|
40
40
|
if (!report) {
|
|
41
|
-
return null
|
|
41
|
+
return null;
|
|
42
42
|
}
|
|
43
43
|
if (report.header && report.header.glibcVersionRuntime) {
|
|
44
|
-
return false
|
|
44
|
+
return false;
|
|
45
45
|
}
|
|
46
46
|
if (Array.isArray(report.sharedObjects)) {
|
|
47
47
|
if (report.sharedObjects.some(isFileMusl)) {
|
|
48
|
-
return true
|
|
48
|
+
return true;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
return false
|
|
52
|
-
}
|
|
51
|
+
return false;
|
|
52
|
+
};
|
|
53
53
|
|
|
54
54
|
const isMuslFromChildProcess = () => {
|
|
55
55
|
try {
|
|
56
|
-
return require(
|
|
56
|
+
return require("child_process")
|
|
57
|
+
.execSync("ldd --version", { encoding: "utf8" })
|
|
58
|
+
.includes("musl");
|
|
57
59
|
} catch (e) {
|
|
58
60
|
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
|
59
|
-
return false
|
|
61
|
+
return false;
|
|
60
62
|
}
|
|
61
|
-
}
|
|
63
|
+
};
|
|
62
64
|
|
|
63
65
|
function requireNative() {
|
|
64
66
|
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
65
67
|
try {
|
|
66
68
|
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
67
69
|
} catch (err) {
|
|
68
|
-
loadErrors.push(err)
|
|
70
|
+
loadErrors.push(err);
|
|
69
71
|
}
|
|
70
|
-
} else if (process.platform ===
|
|
71
|
-
if (process.arch ===
|
|
72
|
+
} else if (process.platform === "android") {
|
|
73
|
+
if (process.arch === "arm64") {
|
|
72
74
|
try {
|
|
73
|
-
return require(
|
|
75
|
+
return require("./html-to-markdown-node.android-arm64.node");
|
|
74
76
|
} catch (e) {
|
|
75
|
-
loadErrors.push(e)
|
|
77
|
+
loadErrors.push(e);
|
|
76
78
|
}
|
|
77
79
|
try {
|
|
78
|
-
const binding = require(
|
|
79
|
-
const bindingPackageVersion =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
const binding = require("@kreuzberg/html-to-markdown-node-android-arm64");
|
|
81
|
+
const bindingPackageVersion =
|
|
82
|
+
require("@kreuzberg/html-to-markdown-node-android-arm64/package.json").version;
|
|
83
|
+
if (
|
|
84
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
85
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
86
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
87
|
+
) {
|
|
88
|
+
throw new Error(
|
|
89
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
return binding;
|
|
84
93
|
} catch (e) {
|
|
85
|
-
loadErrors.push(e)
|
|
94
|
+
loadErrors.push(e);
|
|
86
95
|
}
|
|
87
|
-
} else if (process.arch ===
|
|
96
|
+
} else if (process.arch === "arm") {
|
|
88
97
|
try {
|
|
89
|
-
return require(
|
|
98
|
+
return require("./html-to-markdown-node.android-arm-eabi.node");
|
|
90
99
|
} catch (e) {
|
|
91
|
-
loadErrors.push(e)
|
|
100
|
+
loadErrors.push(e);
|
|
92
101
|
}
|
|
93
102
|
try {
|
|
94
|
-
const binding = require(
|
|
95
|
-
const bindingPackageVersion =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
const binding = require("@kreuzberg/html-to-markdown-node-android-arm-eabi");
|
|
104
|
+
const bindingPackageVersion =
|
|
105
|
+
require("@kreuzberg/html-to-markdown-node-android-arm-eabi/package.json").version;
|
|
106
|
+
if (
|
|
107
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
108
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
109
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
110
|
+
) {
|
|
111
|
+
throw new Error(
|
|
112
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return binding;
|
|
100
116
|
} catch (e) {
|
|
101
|
-
loadErrors.push(e)
|
|
117
|
+
loadErrors.push(e);
|
|
102
118
|
}
|
|
103
119
|
} else {
|
|
104
|
-
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
|
|
120
|
+
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
105
121
|
}
|
|
106
|
-
} else if (process.platform ===
|
|
107
|
-
if (process.arch ===
|
|
108
|
-
if (
|
|
122
|
+
} else if (process.platform === "win32") {
|
|
123
|
+
if (process.arch === "x64") {
|
|
124
|
+
if (
|
|
125
|
+
process.config?.variables?.shlib_suffix === "dll.a" ||
|
|
126
|
+
process.config?.variables?.node_target_type === "shared_library"
|
|
127
|
+
) {
|
|
109
128
|
try {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
return require("./html-to-markdown-node.win32-x64-gnu.node");
|
|
130
|
+
} catch (e) {
|
|
131
|
+
loadErrors.push(e);
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
const binding = require("@kreuzberg/html-to-markdown-node-win32-x64-gnu");
|
|
135
|
+
const bindingPackageVersion =
|
|
136
|
+
require("@kreuzberg/html-to-markdown-node-win32-x64-gnu/package.json").version;
|
|
137
|
+
if (
|
|
138
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
139
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
140
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
141
|
+
) {
|
|
142
|
+
throw new Error(
|
|
143
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
return binding;
|
|
147
|
+
} catch (e) {
|
|
148
|
+
loadErrors.push(e);
|
|
119
149
|
}
|
|
120
|
-
return binding
|
|
121
|
-
} catch (e) {
|
|
122
|
-
loadErrors.push(e)
|
|
123
|
-
}
|
|
124
150
|
} else {
|
|
125
151
|
try {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
152
|
+
return require("./html-to-markdown-node.win32-x64-msvc.node");
|
|
153
|
+
} catch (e) {
|
|
154
|
+
loadErrors.push(e);
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
const binding = require("@kreuzberg/html-to-markdown-node-win32-x64-msvc");
|
|
158
|
+
const bindingPackageVersion =
|
|
159
|
+
require("@kreuzberg/html-to-markdown-node-win32-x64-msvc/package.json").version;
|
|
160
|
+
if (
|
|
161
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
162
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
163
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
164
|
+
) {
|
|
165
|
+
throw new Error(
|
|
166
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
return binding;
|
|
170
|
+
} catch (e) {
|
|
171
|
+
loadErrors.push(e);
|
|
135
172
|
}
|
|
136
|
-
return binding
|
|
137
|
-
} catch (e) {
|
|
138
|
-
loadErrors.push(e)
|
|
139
|
-
}
|
|
140
173
|
}
|
|
141
|
-
} else if (process.arch ===
|
|
174
|
+
} else if (process.arch === "ia32") {
|
|
142
175
|
try {
|
|
143
|
-
return require(
|
|
176
|
+
return require("./html-to-markdown-node.win32-ia32-msvc.node");
|
|
144
177
|
} catch (e) {
|
|
145
|
-
loadErrors.push(e)
|
|
178
|
+
loadErrors.push(e);
|
|
146
179
|
}
|
|
147
180
|
try {
|
|
148
|
-
const binding = require(
|
|
149
|
-
const bindingPackageVersion =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
181
|
+
const binding = require("@kreuzberg/html-to-markdown-node-win32-ia32-msvc");
|
|
182
|
+
const bindingPackageVersion =
|
|
183
|
+
require("@kreuzberg/html-to-markdown-node-win32-ia32-msvc/package.json").version;
|
|
184
|
+
if (
|
|
185
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
186
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
187
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
188
|
+
) {
|
|
189
|
+
throw new Error(
|
|
190
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return binding;
|
|
154
194
|
} catch (e) {
|
|
155
|
-
loadErrors.push(e)
|
|
195
|
+
loadErrors.push(e);
|
|
156
196
|
}
|
|
157
|
-
} else if (process.arch ===
|
|
197
|
+
} else if (process.arch === "arm64") {
|
|
158
198
|
try {
|
|
159
|
-
return require(
|
|
199
|
+
return require("./html-to-markdown-node.win32-arm64-msvc.node");
|
|
160
200
|
} catch (e) {
|
|
161
|
-
loadErrors.push(e)
|
|
201
|
+
loadErrors.push(e);
|
|
162
202
|
}
|
|
163
203
|
try {
|
|
164
|
-
const binding = require(
|
|
165
|
-
const bindingPackageVersion =
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
204
|
+
const binding = require("@kreuzberg/html-to-markdown-node-win32-arm64-msvc");
|
|
205
|
+
const bindingPackageVersion =
|
|
206
|
+
require("@kreuzberg/html-to-markdown-node-win32-arm64-msvc/package.json").version;
|
|
207
|
+
if (
|
|
208
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
209
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
210
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
211
|
+
) {
|
|
212
|
+
throw new Error(
|
|
213
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
return binding;
|
|
170
217
|
} catch (e) {
|
|
171
|
-
loadErrors.push(e)
|
|
218
|
+
loadErrors.push(e);
|
|
172
219
|
}
|
|
173
220
|
} else {
|
|
174
|
-
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
|
|
221
|
+
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
175
222
|
}
|
|
176
|
-
} else if (process.platform ===
|
|
223
|
+
} else if (process.platform === "darwin") {
|
|
177
224
|
try {
|
|
178
|
-
return require(
|
|
225
|
+
return require("./html-to-markdown-node.darwin-universal.node");
|
|
179
226
|
} catch (e) {
|
|
180
|
-
loadErrors.push(e)
|
|
227
|
+
loadErrors.push(e);
|
|
181
228
|
}
|
|
182
229
|
try {
|
|
183
|
-
const binding = require(
|
|
184
|
-
const bindingPackageVersion =
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
230
|
+
const binding = require("@kreuzberg/html-to-markdown-node-darwin-universal");
|
|
231
|
+
const bindingPackageVersion =
|
|
232
|
+
require("@kreuzberg/html-to-markdown-node-darwin-universal/package.json").version;
|
|
233
|
+
if (
|
|
234
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
235
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
236
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
237
|
+
) {
|
|
238
|
+
throw new Error(
|
|
239
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
return binding;
|
|
189
243
|
} catch (e) {
|
|
190
|
-
loadErrors.push(e)
|
|
244
|
+
loadErrors.push(e);
|
|
191
245
|
}
|
|
192
|
-
if (process.arch ===
|
|
246
|
+
if (process.arch === "x64") {
|
|
193
247
|
try {
|
|
194
|
-
return require(
|
|
248
|
+
return require("./html-to-markdown-node.darwin-x64.node");
|
|
195
249
|
} catch (e) {
|
|
196
|
-
loadErrors.push(e)
|
|
250
|
+
loadErrors.push(e);
|
|
197
251
|
}
|
|
198
252
|
try {
|
|
199
|
-
const binding = require(
|
|
200
|
-
const bindingPackageVersion =
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
253
|
+
const binding = require("@kreuzberg/html-to-markdown-node-darwin-x64");
|
|
254
|
+
const bindingPackageVersion =
|
|
255
|
+
require("@kreuzberg/html-to-markdown-node-darwin-x64/package.json").version;
|
|
256
|
+
if (
|
|
257
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
258
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
259
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
260
|
+
) {
|
|
261
|
+
throw new Error(
|
|
262
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
return binding;
|
|
205
266
|
} catch (e) {
|
|
206
|
-
loadErrors.push(e)
|
|
267
|
+
loadErrors.push(e);
|
|
207
268
|
}
|
|
208
|
-
} else if (process.arch ===
|
|
269
|
+
} else if (process.arch === "arm64") {
|
|
209
270
|
try {
|
|
210
|
-
return require(
|
|
271
|
+
return require("./html-to-markdown-node.darwin-arm64.node");
|
|
211
272
|
} catch (e) {
|
|
212
|
-
loadErrors.push(e)
|
|
273
|
+
loadErrors.push(e);
|
|
213
274
|
}
|
|
214
275
|
try {
|
|
215
|
-
const binding = require(
|
|
216
|
-
const bindingPackageVersion =
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
276
|
+
const binding = require("@kreuzberg/html-to-markdown-node-darwin-arm64");
|
|
277
|
+
const bindingPackageVersion =
|
|
278
|
+
require("@kreuzberg/html-to-markdown-node-darwin-arm64/package.json").version;
|
|
279
|
+
if (
|
|
280
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
281
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
282
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
283
|
+
) {
|
|
284
|
+
throw new Error(
|
|
285
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
return binding;
|
|
221
289
|
} catch (e) {
|
|
222
|
-
loadErrors.push(e)
|
|
290
|
+
loadErrors.push(e);
|
|
223
291
|
}
|
|
224
292
|
} else {
|
|
225
|
-
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
|
|
293
|
+
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
226
294
|
}
|
|
227
|
-
} else if (process.platform ===
|
|
228
|
-
if (process.arch ===
|
|
295
|
+
} else if (process.platform === "freebsd") {
|
|
296
|
+
if (process.arch === "x64") {
|
|
229
297
|
try {
|
|
230
|
-
return require(
|
|
298
|
+
return require("./html-to-markdown-node.freebsd-x64.node");
|
|
231
299
|
} catch (e) {
|
|
232
|
-
loadErrors.push(e)
|
|
300
|
+
loadErrors.push(e);
|
|
233
301
|
}
|
|
234
302
|
try {
|
|
235
|
-
const binding = require(
|
|
236
|
-
const bindingPackageVersion =
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
303
|
+
const binding = require("@kreuzberg/html-to-markdown-node-freebsd-x64");
|
|
304
|
+
const bindingPackageVersion =
|
|
305
|
+
require("@kreuzberg/html-to-markdown-node-freebsd-x64/package.json").version;
|
|
306
|
+
if (
|
|
307
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
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 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
return binding;
|
|
241
316
|
} catch (e) {
|
|
242
|
-
loadErrors.push(e)
|
|
317
|
+
loadErrors.push(e);
|
|
243
318
|
}
|
|
244
|
-
} else if (process.arch ===
|
|
319
|
+
} else if (process.arch === "arm64") {
|
|
245
320
|
try {
|
|
246
|
-
return require(
|
|
321
|
+
return require("./html-to-markdown-node.freebsd-arm64.node");
|
|
247
322
|
} catch (e) {
|
|
248
|
-
loadErrors.push(e)
|
|
323
|
+
loadErrors.push(e);
|
|
249
324
|
}
|
|
250
325
|
try {
|
|
251
|
-
const binding = require(
|
|
252
|
-
const bindingPackageVersion =
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
326
|
+
const binding = require("@kreuzberg/html-to-markdown-node-freebsd-arm64");
|
|
327
|
+
const bindingPackageVersion =
|
|
328
|
+
require("@kreuzberg/html-to-markdown-node-freebsd-arm64/package.json").version;
|
|
329
|
+
if (
|
|
330
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
331
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
332
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
333
|
+
) {
|
|
334
|
+
throw new Error(
|
|
335
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
return binding;
|
|
257
339
|
} catch (e) {
|
|
258
|
-
loadErrors.push(e)
|
|
340
|
+
loadErrors.push(e);
|
|
259
341
|
}
|
|
260
342
|
} else {
|
|
261
|
-
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
|
|
343
|
+
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
262
344
|
}
|
|
263
|
-
} else if (process.platform ===
|
|
264
|
-
if (process.arch ===
|
|
345
|
+
} else if (process.platform === "linux") {
|
|
346
|
+
if (process.arch === "x64") {
|
|
265
347
|
if (isMusl()) {
|
|
266
348
|
try {
|
|
267
|
-
return require(
|
|
349
|
+
return require("./html-to-markdown-node.linux-x64-musl.node");
|
|
268
350
|
} catch (e) {
|
|
269
|
-
loadErrors.push(e)
|
|
351
|
+
loadErrors.push(e);
|
|
270
352
|
}
|
|
271
353
|
try {
|
|
272
|
-
const binding = require(
|
|
273
|
-
const bindingPackageVersion =
|
|
274
|
-
|
|
275
|
-
|
|
354
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-x64-musl");
|
|
355
|
+
const bindingPackageVersion =
|
|
356
|
+
require("@kreuzberg/html-to-markdown-node-linux-x64-musl/package.json").version;
|
|
357
|
+
if (
|
|
358
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
359
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
360
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
361
|
+
) {
|
|
362
|
+
throw new Error(
|
|
363
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
364
|
+
);
|
|
276
365
|
}
|
|
277
|
-
return binding
|
|
366
|
+
return binding;
|
|
278
367
|
} catch (e) {
|
|
279
|
-
loadErrors.push(e)
|
|
368
|
+
loadErrors.push(e);
|
|
280
369
|
}
|
|
281
370
|
} else {
|
|
282
371
|
try {
|
|
283
|
-
return require(
|
|
372
|
+
return require("./html-to-markdown-node.linux-x64-gnu.node");
|
|
284
373
|
} catch (e) {
|
|
285
|
-
loadErrors.push(e)
|
|
374
|
+
loadErrors.push(e);
|
|
286
375
|
}
|
|
287
376
|
try {
|
|
288
|
-
const binding = require(
|
|
289
|
-
const bindingPackageVersion =
|
|
290
|
-
|
|
291
|
-
|
|
377
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-x64-gnu");
|
|
378
|
+
const bindingPackageVersion =
|
|
379
|
+
require("@kreuzberg/html-to-markdown-node-linux-x64-gnu/package.json").version;
|
|
380
|
+
if (
|
|
381
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
382
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
383
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
384
|
+
) {
|
|
385
|
+
throw new Error(
|
|
386
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
387
|
+
);
|
|
292
388
|
}
|
|
293
|
-
return binding
|
|
389
|
+
return binding;
|
|
294
390
|
} catch (e) {
|
|
295
|
-
loadErrors.push(e)
|
|
391
|
+
loadErrors.push(e);
|
|
296
392
|
}
|
|
297
393
|
}
|
|
298
|
-
} else if (process.arch ===
|
|
394
|
+
} else if (process.arch === "arm64") {
|
|
299
395
|
if (isMusl()) {
|
|
300
396
|
try {
|
|
301
|
-
return require(
|
|
397
|
+
return require("./html-to-markdown-node.linux-arm64-musl.node");
|
|
302
398
|
} catch (e) {
|
|
303
|
-
loadErrors.push(e)
|
|
399
|
+
loadErrors.push(e);
|
|
304
400
|
}
|
|
305
401
|
try {
|
|
306
|
-
const binding = require(
|
|
307
|
-
const bindingPackageVersion =
|
|
308
|
-
|
|
309
|
-
|
|
402
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-arm64-musl");
|
|
403
|
+
const bindingPackageVersion =
|
|
404
|
+
require("@kreuzberg/html-to-markdown-node-linux-arm64-musl/package.json").version;
|
|
405
|
+
if (
|
|
406
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
407
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
408
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
409
|
+
) {
|
|
410
|
+
throw new Error(
|
|
411
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
412
|
+
);
|
|
310
413
|
}
|
|
311
|
-
return binding
|
|
414
|
+
return binding;
|
|
312
415
|
} catch (e) {
|
|
313
|
-
loadErrors.push(e)
|
|
416
|
+
loadErrors.push(e);
|
|
314
417
|
}
|
|
315
418
|
} else {
|
|
316
419
|
try {
|
|
317
|
-
return require(
|
|
420
|
+
return require("./html-to-markdown-node.linux-arm64-gnu.node");
|
|
318
421
|
} catch (e) {
|
|
319
|
-
loadErrors.push(e)
|
|
422
|
+
loadErrors.push(e);
|
|
320
423
|
}
|
|
321
424
|
try {
|
|
322
|
-
const binding = require(
|
|
323
|
-
const bindingPackageVersion =
|
|
324
|
-
|
|
325
|
-
|
|
425
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-arm64-gnu");
|
|
426
|
+
const bindingPackageVersion =
|
|
427
|
+
require("@kreuzberg/html-to-markdown-node-linux-arm64-gnu/package.json").version;
|
|
428
|
+
if (
|
|
429
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
430
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
431
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
432
|
+
) {
|
|
433
|
+
throw new Error(
|
|
434
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
435
|
+
);
|
|
326
436
|
}
|
|
327
|
-
return binding
|
|
437
|
+
return binding;
|
|
328
438
|
} catch (e) {
|
|
329
|
-
loadErrors.push(e)
|
|
439
|
+
loadErrors.push(e);
|
|
330
440
|
}
|
|
331
441
|
}
|
|
332
|
-
} else if (process.arch ===
|
|
442
|
+
} else if (process.arch === "arm") {
|
|
333
443
|
if (isMusl()) {
|
|
334
444
|
try {
|
|
335
|
-
return require(
|
|
445
|
+
return require("./html-to-markdown-node.linux-arm-musleabihf.node");
|
|
336
446
|
} catch (e) {
|
|
337
|
-
loadErrors.push(e)
|
|
447
|
+
loadErrors.push(e);
|
|
338
448
|
}
|
|
339
449
|
try {
|
|
340
|
-
const binding = require(
|
|
341
|
-
const bindingPackageVersion =
|
|
342
|
-
|
|
343
|
-
|
|
450
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-arm-musleabihf");
|
|
451
|
+
const bindingPackageVersion =
|
|
452
|
+
require("@kreuzberg/html-to-markdown-node-linux-arm-musleabihf/package.json").version;
|
|
453
|
+
if (
|
|
454
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
455
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
456
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
457
|
+
) {
|
|
458
|
+
throw new Error(
|
|
459
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
460
|
+
);
|
|
344
461
|
}
|
|
345
|
-
return binding
|
|
462
|
+
return binding;
|
|
346
463
|
} catch (e) {
|
|
347
|
-
loadErrors.push(e)
|
|
464
|
+
loadErrors.push(e);
|
|
348
465
|
}
|
|
349
466
|
} else {
|
|
350
467
|
try {
|
|
351
|
-
return require(
|
|
468
|
+
return require("./html-to-markdown-node.linux-arm-gnueabihf.node");
|
|
352
469
|
} catch (e) {
|
|
353
|
-
loadErrors.push(e)
|
|
470
|
+
loadErrors.push(e);
|
|
354
471
|
}
|
|
355
472
|
try {
|
|
356
|
-
const binding = require(
|
|
357
|
-
const bindingPackageVersion =
|
|
358
|
-
|
|
359
|
-
|
|
473
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-arm-gnueabihf");
|
|
474
|
+
const bindingPackageVersion =
|
|
475
|
+
require("@kreuzberg/html-to-markdown-node-linux-arm-gnueabihf/package.json").version;
|
|
476
|
+
if (
|
|
477
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
478
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
479
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
480
|
+
) {
|
|
481
|
+
throw new Error(
|
|
482
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
483
|
+
);
|
|
360
484
|
}
|
|
361
|
-
return binding
|
|
485
|
+
return binding;
|
|
362
486
|
} catch (e) {
|
|
363
|
-
loadErrors.push(e)
|
|
487
|
+
loadErrors.push(e);
|
|
364
488
|
}
|
|
365
489
|
}
|
|
366
|
-
} else if (process.arch ===
|
|
490
|
+
} else if (process.arch === "loong64") {
|
|
367
491
|
if (isMusl()) {
|
|
368
492
|
try {
|
|
369
|
-
return require(
|
|
493
|
+
return require("./html-to-markdown-node.linux-loong64-musl.node");
|
|
370
494
|
} catch (e) {
|
|
371
|
-
loadErrors.push(e)
|
|
495
|
+
loadErrors.push(e);
|
|
372
496
|
}
|
|
373
497
|
try {
|
|
374
|
-
const binding = require(
|
|
375
|
-
const bindingPackageVersion =
|
|
376
|
-
|
|
377
|
-
|
|
498
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-loong64-musl");
|
|
499
|
+
const bindingPackageVersion =
|
|
500
|
+
require("@kreuzberg/html-to-markdown-node-linux-loong64-musl/package.json").version;
|
|
501
|
+
if (
|
|
502
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
503
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
504
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
505
|
+
) {
|
|
506
|
+
throw new Error(
|
|
507
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
508
|
+
);
|
|
378
509
|
}
|
|
379
|
-
return binding
|
|
510
|
+
return binding;
|
|
380
511
|
} catch (e) {
|
|
381
|
-
loadErrors.push(e)
|
|
512
|
+
loadErrors.push(e);
|
|
382
513
|
}
|
|
383
514
|
} else {
|
|
384
515
|
try {
|
|
385
|
-
return require(
|
|
516
|
+
return require("./html-to-markdown-node.linux-loong64-gnu.node");
|
|
386
517
|
} catch (e) {
|
|
387
|
-
loadErrors.push(e)
|
|
518
|
+
loadErrors.push(e);
|
|
388
519
|
}
|
|
389
520
|
try {
|
|
390
|
-
const binding = require(
|
|
391
|
-
const bindingPackageVersion =
|
|
392
|
-
|
|
393
|
-
|
|
521
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-loong64-gnu");
|
|
522
|
+
const bindingPackageVersion =
|
|
523
|
+
require("@kreuzberg/html-to-markdown-node-linux-loong64-gnu/package.json").version;
|
|
524
|
+
if (
|
|
525
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
526
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
527
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
528
|
+
) {
|
|
529
|
+
throw new Error(
|
|
530
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
531
|
+
);
|
|
394
532
|
}
|
|
395
|
-
return binding
|
|
533
|
+
return binding;
|
|
396
534
|
} catch (e) {
|
|
397
|
-
loadErrors.push(e)
|
|
535
|
+
loadErrors.push(e);
|
|
398
536
|
}
|
|
399
537
|
}
|
|
400
|
-
} else if (process.arch ===
|
|
538
|
+
} else if (process.arch === "riscv64") {
|
|
401
539
|
if (isMusl()) {
|
|
402
540
|
try {
|
|
403
|
-
return require(
|
|
541
|
+
return require("./html-to-markdown-node.linux-riscv64-musl.node");
|
|
404
542
|
} catch (e) {
|
|
405
|
-
loadErrors.push(e)
|
|
543
|
+
loadErrors.push(e);
|
|
406
544
|
}
|
|
407
545
|
try {
|
|
408
|
-
const binding = require(
|
|
409
|
-
const bindingPackageVersion =
|
|
410
|
-
|
|
411
|
-
|
|
546
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-riscv64-musl");
|
|
547
|
+
const bindingPackageVersion =
|
|
548
|
+
require("@kreuzberg/html-to-markdown-node-linux-riscv64-musl/package.json").version;
|
|
549
|
+
if (
|
|
550
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
551
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
552
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
553
|
+
) {
|
|
554
|
+
throw new Error(
|
|
555
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
556
|
+
);
|
|
412
557
|
}
|
|
413
|
-
return binding
|
|
558
|
+
return binding;
|
|
414
559
|
} catch (e) {
|
|
415
|
-
loadErrors.push(e)
|
|
560
|
+
loadErrors.push(e);
|
|
416
561
|
}
|
|
417
562
|
} else {
|
|
418
563
|
try {
|
|
419
|
-
return require(
|
|
564
|
+
return require("./html-to-markdown-node.linux-riscv64-gnu.node");
|
|
420
565
|
} catch (e) {
|
|
421
|
-
loadErrors.push(e)
|
|
566
|
+
loadErrors.push(e);
|
|
422
567
|
}
|
|
423
568
|
try {
|
|
424
|
-
const binding = require(
|
|
425
|
-
const bindingPackageVersion =
|
|
426
|
-
|
|
427
|
-
|
|
569
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-riscv64-gnu");
|
|
570
|
+
const bindingPackageVersion =
|
|
571
|
+
require("@kreuzberg/html-to-markdown-node-linux-riscv64-gnu/package.json").version;
|
|
572
|
+
if (
|
|
573
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
574
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
575
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
576
|
+
) {
|
|
577
|
+
throw new Error(
|
|
578
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
579
|
+
);
|
|
428
580
|
}
|
|
429
|
-
return binding
|
|
581
|
+
return binding;
|
|
430
582
|
} catch (e) {
|
|
431
|
-
loadErrors.push(e)
|
|
583
|
+
loadErrors.push(e);
|
|
432
584
|
}
|
|
433
585
|
}
|
|
434
|
-
} else if (process.arch ===
|
|
586
|
+
} else if (process.arch === "ppc64") {
|
|
435
587
|
try {
|
|
436
|
-
return require(
|
|
588
|
+
return require("./html-to-markdown-node.linux-ppc64-gnu.node");
|
|
437
589
|
} catch (e) {
|
|
438
|
-
loadErrors.push(e)
|
|
590
|
+
loadErrors.push(e);
|
|
439
591
|
}
|
|
440
592
|
try {
|
|
441
|
-
const binding = require(
|
|
442
|
-
const bindingPackageVersion =
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
593
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-ppc64-gnu");
|
|
594
|
+
const bindingPackageVersion =
|
|
595
|
+
require("@kreuzberg/html-to-markdown-node-linux-ppc64-gnu/package.json").version;
|
|
596
|
+
if (
|
|
597
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
598
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
599
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
600
|
+
) {
|
|
601
|
+
throw new Error(
|
|
602
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
return binding;
|
|
447
606
|
} catch (e) {
|
|
448
|
-
loadErrors.push(e)
|
|
607
|
+
loadErrors.push(e);
|
|
449
608
|
}
|
|
450
|
-
} else if (process.arch ===
|
|
609
|
+
} else if (process.arch === "s390x") {
|
|
451
610
|
try {
|
|
452
|
-
return require(
|
|
611
|
+
return require("./html-to-markdown-node.linux-s390x-gnu.node");
|
|
453
612
|
} catch (e) {
|
|
454
|
-
loadErrors.push(e)
|
|
613
|
+
loadErrors.push(e);
|
|
455
614
|
}
|
|
456
615
|
try {
|
|
457
|
-
const binding = require(
|
|
458
|
-
const bindingPackageVersion =
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
616
|
+
const binding = require("@kreuzberg/html-to-markdown-node-linux-s390x-gnu");
|
|
617
|
+
const bindingPackageVersion =
|
|
618
|
+
require("@kreuzberg/html-to-markdown-node-linux-s390x-gnu/package.json").version;
|
|
619
|
+
if (
|
|
620
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
621
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
622
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
623
|
+
) {
|
|
624
|
+
throw new Error(
|
|
625
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
return binding;
|
|
463
629
|
} catch (e) {
|
|
464
|
-
loadErrors.push(e)
|
|
630
|
+
loadErrors.push(e);
|
|
465
631
|
}
|
|
466
632
|
} else {
|
|
467
|
-
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
|
|
633
|
+
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
468
634
|
}
|
|
469
|
-
} else if (process.platform ===
|
|
470
|
-
if (process.arch ===
|
|
635
|
+
} else if (process.platform === "openharmony") {
|
|
636
|
+
if (process.arch === "arm64") {
|
|
471
637
|
try {
|
|
472
|
-
return require(
|
|
638
|
+
return require("./html-to-markdown-node.openharmony-arm64.node");
|
|
473
639
|
} catch (e) {
|
|
474
|
-
loadErrors.push(e)
|
|
640
|
+
loadErrors.push(e);
|
|
475
641
|
}
|
|
476
642
|
try {
|
|
477
|
-
const binding = require(
|
|
478
|
-
const bindingPackageVersion =
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
643
|
+
const binding = require("@kreuzberg/html-to-markdown-node-openharmony-arm64");
|
|
644
|
+
const bindingPackageVersion =
|
|
645
|
+
require("@kreuzberg/html-to-markdown-node-openharmony-arm64/package.json").version;
|
|
646
|
+
if (
|
|
647
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
648
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
649
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
650
|
+
) {
|
|
651
|
+
throw new Error(
|
|
652
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
653
|
+
);
|
|
654
|
+
}
|
|
655
|
+
return binding;
|
|
483
656
|
} catch (e) {
|
|
484
|
-
loadErrors.push(e)
|
|
657
|
+
loadErrors.push(e);
|
|
485
658
|
}
|
|
486
|
-
} else if (process.arch ===
|
|
659
|
+
} else if (process.arch === "x64") {
|
|
487
660
|
try {
|
|
488
|
-
return require(
|
|
661
|
+
return require("./html-to-markdown-node.openharmony-x64.node");
|
|
489
662
|
} catch (e) {
|
|
490
|
-
loadErrors.push(e)
|
|
663
|
+
loadErrors.push(e);
|
|
491
664
|
}
|
|
492
665
|
try {
|
|
493
|
-
const binding = require(
|
|
494
|
-
const bindingPackageVersion =
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
666
|
+
const binding = require("@kreuzberg/html-to-markdown-node-openharmony-x64");
|
|
667
|
+
const bindingPackageVersion =
|
|
668
|
+
require("@kreuzberg/html-to-markdown-node-openharmony-x64/package.json").version;
|
|
669
|
+
if (
|
|
670
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
671
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
672
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
673
|
+
) {
|
|
674
|
+
throw new Error(
|
|
675
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
return binding;
|
|
499
679
|
} catch (e) {
|
|
500
|
-
loadErrors.push(e)
|
|
680
|
+
loadErrors.push(e);
|
|
501
681
|
}
|
|
502
|
-
} else if (process.arch ===
|
|
682
|
+
} else if (process.arch === "arm") {
|
|
503
683
|
try {
|
|
504
|
-
return require(
|
|
684
|
+
return require("./html-to-markdown-node.openharmony-arm.node");
|
|
505
685
|
} catch (e) {
|
|
506
|
-
loadErrors.push(e)
|
|
686
|
+
loadErrors.push(e);
|
|
507
687
|
}
|
|
508
688
|
try {
|
|
509
|
-
const binding = require(
|
|
510
|
-
const bindingPackageVersion =
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
689
|
+
const binding = require("@kreuzberg/html-to-markdown-node-openharmony-arm");
|
|
690
|
+
const bindingPackageVersion =
|
|
691
|
+
require("@kreuzberg/html-to-markdown-node-openharmony-arm/package.json").version;
|
|
692
|
+
if (
|
|
693
|
+
bindingPackageVersion !== "3.4.0-rc.27" &&
|
|
694
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
695
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
696
|
+
) {
|
|
697
|
+
throw new Error(
|
|
698
|
+
`Native binding package version mismatch, expected 3.4.0-rc.27 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
return binding;
|
|
515
702
|
} catch (e) {
|
|
516
|
-
loadErrors.push(e)
|
|
703
|
+
loadErrors.push(e);
|
|
517
704
|
}
|
|
518
705
|
} else {
|
|
519
|
-
loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
|
|
706
|
+
loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
520
707
|
}
|
|
521
708
|
} else {
|
|
522
|
-
loadErrors.push(
|
|
709
|
+
loadErrors.push(
|
|
710
|
+
new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`),
|
|
711
|
+
);
|
|
523
712
|
}
|
|
524
713
|
}
|
|
525
714
|
|
|
526
|
-
nativeBinding = requireNative()
|
|
715
|
+
nativeBinding = requireNative();
|
|
527
716
|
|
|
528
717
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
529
|
-
let wasiBinding = null
|
|
530
|
-
let wasiBindingError = null
|
|
718
|
+
let wasiBinding = null;
|
|
719
|
+
let wasiBindingError = null;
|
|
531
720
|
try {
|
|
532
|
-
wasiBinding = require(
|
|
533
|
-
nativeBinding = wasiBinding
|
|
721
|
+
wasiBinding = require("./html-to-markdown-node.wasi.cjs");
|
|
722
|
+
nativeBinding = wasiBinding;
|
|
534
723
|
} catch (err) {
|
|
535
724
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
536
|
-
wasiBindingError = err
|
|
725
|
+
wasiBindingError = err;
|
|
537
726
|
}
|
|
538
727
|
}
|
|
539
728
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
540
729
|
try {
|
|
541
|
-
wasiBinding = require(
|
|
542
|
-
nativeBinding = wasiBinding
|
|
730
|
+
wasiBinding = require("@kreuzberg/html-to-markdown-node-wasm32-wasi");
|
|
731
|
+
nativeBinding = wasiBinding;
|
|
543
732
|
} catch (err) {
|
|
544
733
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
545
734
|
if (!wasiBindingError) {
|
|
546
|
-
wasiBindingError = err
|
|
735
|
+
wasiBindingError = err;
|
|
547
736
|
} else {
|
|
548
|
-
wasiBindingError.cause = err
|
|
737
|
+
wasiBindingError.cause = err;
|
|
549
738
|
}
|
|
550
|
-
loadErrors.push(err)
|
|
739
|
+
loadErrors.push(err);
|
|
551
740
|
}
|
|
552
741
|
}
|
|
553
742
|
}
|
|
554
|
-
if (process.env.NAPI_RS_FORCE_WASI ===
|
|
555
|
-
const error = new Error(
|
|
556
|
-
error.cause = wasiBindingError
|
|
557
|
-
throw error
|
|
743
|
+
if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
|
|
744
|
+
const error = new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
|
745
|
+
error.cause = wasiBindingError;
|
|
746
|
+
throw error;
|
|
558
747
|
}
|
|
559
748
|
}
|
|
560
749
|
|
|
@@ -563,34 +752,35 @@ if (!nativeBinding) {
|
|
|
563
752
|
throw new Error(
|
|
564
753
|
`Cannot find native binding. ` +
|
|
565
754
|
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
566
|
-
|
|
755
|
+
"Please try `npm i` again after removing both package-lock.json and node_modules directory.",
|
|
567
756
|
{
|
|
568
757
|
cause: loadErrors.reduce((err, cur) => {
|
|
569
|
-
cur.cause = err
|
|
570
|
-
return cur
|
|
758
|
+
cur.cause = err;
|
|
759
|
+
return cur;
|
|
571
760
|
}),
|
|
572
761
|
},
|
|
573
|
-
)
|
|
762
|
+
);
|
|
574
763
|
}
|
|
575
|
-
throw new Error(`Failed to load native binding`)
|
|
764
|
+
throw new Error(`Failed to load native binding`);
|
|
576
765
|
}
|
|
577
766
|
|
|
578
|
-
module.exports = nativeBinding
|
|
579
|
-
module.exports.
|
|
580
|
-
module.exports.
|
|
581
|
-
module.exports.
|
|
582
|
-
module.exports.
|
|
583
|
-
module.exports.
|
|
584
|
-
module.exports.
|
|
585
|
-
module.exports.
|
|
586
|
-
module.exports.
|
|
587
|
-
module.exports.
|
|
588
|
-
module.exports.
|
|
589
|
-
module.exports.
|
|
590
|
-
module.exports.
|
|
591
|
-
module.exports.
|
|
592
|
-
module.exports.
|
|
593
|
-
module.exports.
|
|
594
|
-
module.exports.
|
|
595
|
-
module.exports.
|
|
596
|
-
module.exports.
|
|
767
|
+
module.exports = nativeBinding;
|
|
768
|
+
module.exports.JsConversionOptionsBuilder = nativeBinding.JsConversionOptionsBuilder;
|
|
769
|
+
module.exports.JsVisitorHandle = nativeBinding.JsVisitorHandle;
|
|
770
|
+
module.exports.convert = nativeBinding.convert;
|
|
771
|
+
module.exports.JsCodeBlockStyle = nativeBinding.JsCodeBlockStyle;
|
|
772
|
+
module.exports.JsHeadingStyle = nativeBinding.JsHeadingStyle;
|
|
773
|
+
module.exports.JsHighlightStyle = nativeBinding.JsHighlightStyle;
|
|
774
|
+
module.exports.JsImageType = nativeBinding.JsImageType;
|
|
775
|
+
module.exports.JsLinkStyle = nativeBinding.JsLinkStyle;
|
|
776
|
+
module.exports.JsLinkType = nativeBinding.JsLinkType;
|
|
777
|
+
module.exports.JsListIndentType = nativeBinding.JsListIndentType;
|
|
778
|
+
module.exports.JsNewlineStyle = nativeBinding.JsNewlineStyle;
|
|
779
|
+
module.exports.JsNodeType = nativeBinding.JsNodeType;
|
|
780
|
+
module.exports.JsOutputFormat = nativeBinding.JsOutputFormat;
|
|
781
|
+
module.exports.JsPreprocessingPreset = nativeBinding.JsPreprocessingPreset;
|
|
782
|
+
module.exports.JsStructuredDataType = nativeBinding.JsStructuredDataType;
|
|
783
|
+
module.exports.JsTextDirection = nativeBinding.JsTextDirection;
|
|
784
|
+
module.exports.JsVisitResult = nativeBinding.JsVisitResult;
|
|
785
|
+
module.exports.JsWarningKind = nativeBinding.JsWarningKind;
|
|
786
|
+
module.exports.JsWhitespaceMode = nativeBinding.JsWhitespaceMode;
|
package/package.json
CHANGED
|
@@ -1,69 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kreuzberg/html-to-markdown-node",
|
|
3
|
-
"version": "3.4.0
|
|
4
|
-
"description": "High-performance HTML to Markdown converter
|
|
5
|
-
"
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"repository": "https://github.com/kreuzberg-dev/html-to-markdown",
|
|
8
|
-
"homepage": "https://kreuzberg.dev",
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"author": "Na'aman Hirschfeld <naaman@kreuzberg.dev>",
|
|
3
|
+
"version": "3.4.0",
|
|
4
|
+
"description": "High-performance HTML to Markdown converter",
|
|
5
|
+
"homepage": "https://github.com/kreuzberg-dev/html-to-markdown",
|
|
11
6
|
"bugs": "https://github.com/kreuzberg-dev/html-to-markdown/issues",
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
],
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/kreuzberg-dev/html-to-markdown.git",
|
|
11
|
+
"directory": "crates/html-to-markdown-node"
|
|
12
|
+
},
|
|
19
13
|
"files": [
|
|
20
14
|
"index.js",
|
|
21
15
|
"index.d.ts",
|
|
22
|
-
"*.node"
|
|
23
|
-
"README.md"
|
|
16
|
+
"*.node"
|
|
24
17
|
],
|
|
18
|
+
"main": "index.js",
|
|
19
|
+
"types": "index.d.ts",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "napi build --platform --release",
|
|
22
|
+
"artifacts": "napi artifacts",
|
|
23
|
+
"prepublishOnly": "napi prepublish -t npm --skip-optional-publish"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@napi-rs/cli": "^3.6.2"
|
|
27
|
+
},
|
|
25
28
|
"napi": {
|
|
26
29
|
"binaryName": "html-to-markdown-node",
|
|
27
30
|
"targets": [
|
|
28
|
-
"x86_64-apple-darwin",
|
|
29
|
-
"aarch64-apple-darwin",
|
|
30
|
-
"x86_64-pc-windows-msvc",
|
|
31
|
-
"aarch64-pc-windows-msvc",
|
|
32
31
|
"x86_64-unknown-linux-gnu",
|
|
33
|
-
"x86_64-unknown-linux-musl",
|
|
34
32
|
"aarch64-unknown-linux-gnu",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
33
|
+
"x86_64-apple-darwin",
|
|
34
|
+
"aarch64-apple-darwin",
|
|
35
|
+
"x86_64-pc-windows-msvc"
|
|
37
36
|
]
|
|
38
37
|
},
|
|
39
38
|
"engines": {
|
|
40
|
-
"node": ">=
|
|
41
|
-
},
|
|
42
|
-
"publishConfig": {
|
|
43
|
-
"registry": "https://registry.npmjs.org/",
|
|
44
|
-
"access": "public"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"artifacts": "napi artifacts",
|
|
48
|
-
"build": "napi build --platform --release",
|
|
49
|
-
"build:debug": "napi build --platform",
|
|
50
|
-
"prepublishOnly": "napi prepublish -t npm",
|
|
51
|
-
"test": "node -e \"console.log('ok')\"",
|
|
52
|
-
"version": "napi version",
|
|
53
|
-
"clean": "rm -rf *.node"
|
|
54
|
-
},
|
|
55
|
-
"devDependencies": {
|
|
56
|
-
"@napi-rs/cli": "^3.6.2"
|
|
39
|
+
"node": ">= 18"
|
|
57
40
|
},
|
|
58
41
|
"optionalDependencies": {
|
|
59
|
-
"@kreuzberg/html-to-markdown-node-darwin-arm64": "3.4.0
|
|
60
|
-
"@kreuzberg/html-to-markdown-node-darwin-x64": "3.4.0
|
|
61
|
-
"@kreuzberg/html-to-markdown-node-linux-
|
|
62
|
-
"@kreuzberg/html-to-markdown-node-linux-
|
|
63
|
-
"@kreuzberg/html-to-markdown-node-
|
|
64
|
-
"@kreuzberg/html-to-markdown-node-linux-x64-gnu": "3.4.0-rc.8",
|
|
65
|
-
"@kreuzberg/html-to-markdown-node-linux-x64-musl": "3.4.0-rc.8",
|
|
66
|
-
"@kreuzberg/html-to-markdown-node-win32-arm64-msvc": "3.4.0-rc.8",
|
|
67
|
-
"@kreuzberg/html-to-markdown-node-win32-x64-msvc": "3.4.0-rc.8"
|
|
42
|
+
"@kreuzberg/html-to-markdown-node-darwin-arm64": "3.4.0",
|
|
43
|
+
"@kreuzberg/html-to-markdown-node-darwin-x64": "3.4.0",
|
|
44
|
+
"@kreuzberg/html-to-markdown-node-linux-arm64-gnu": "3.4.0",
|
|
45
|
+
"@kreuzberg/html-to-markdown-node-linux-x64-gnu": "3.4.0",
|
|
46
|
+
"@kreuzberg/html-to-markdown-node-win32-x64-msvc": "3.4.0"
|
|
68
47
|
}
|
|
69
48
|
}
|