pagesift 0.12.1 → 0.20.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/README.md +19 -4
- package/index.d.ts +4 -2
- package/index.js +54 -54
- package/package.json +11 -7
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# pagesift (Node.js)
|
|
2
2
|
|
|
3
|
+
0.20.0: see the [release and migration guide](https://github.com/YOLOW92/pagesift/blob/main/docs/releases/0.20.0.md). New collection/archive cores are available through Rust and CLI; this package keeps its documented scraping interface.
|
|
4
|
+
|
|
3
5
|
The npm package `pagesift`: pagesift's Rust engine for Node.js, built with [napi-rs](https://napi.rs).
|
|
4
6
|
Prebuilt binaries, so you don't need a Rust toolchain or a headless-browser download.
|
|
5
7
|
The API is designed for throughput first: batches are scheduled in Rust, results stay in Rust until you read them,
|
|
@@ -13,7 +15,7 @@ import { convert, convertMany, Scraper, PagesiftError } from 'pagesift'
|
|
|
13
15
|
const page = convert(html, { url: 'https://example.com/post' })
|
|
14
16
|
console.log(page.markdown, page.metadata.title)
|
|
15
17
|
|
|
16
|
-
// Many documents: one call,
|
|
18
|
+
// Many documents: one call, bounded Rust workers, bytes in (no string transcoding)
|
|
17
19
|
const pages = await convertMany(await Promise.all(files.map((f) => readFile(f))))
|
|
18
20
|
|
|
19
21
|
// Fetching: create one Scraper and keep it (connection pool, robots.txt cache, rate-limit state, browsers)
|
|
@@ -129,13 +131,26 @@ which matters when the same process also serves requests. `scrapeStream` deliver
|
|
|
129
131
|
Known limit: requests to a single host currently top out at about 1000 per second even with `requestIntervalMs: 0`
|
|
130
132
|
(the rate limiter waits for a 1 ms timer tick per request), which is why this benchmark spreads its pages over 16 hosts.
|
|
131
133
|
|
|
134
|
+
## CPU budget
|
|
135
|
+
|
|
136
|
+
Asynchronous conversion shares at most `max(1, logical CPUs - 1)` Rust worker slots across calls,
|
|
137
|
+
leaving capacity for Node's event loop. `convertMany` validates and copies all inputs before starting
|
|
138
|
+
CPU workers, so parser work does not compete with the main thread while it copies strings.
|
|
139
|
+
Large string batches still copy synchronously; use UTF-8 buffers or smaller batches when needed.
|
|
140
|
+
The timing figures above predate this 0.20.0 scheduling change; rerun them on your deployment hardware.
|
|
141
|
+
|
|
132
142
|
## Platforms
|
|
133
143
|
|
|
134
144
|
| Target | Status |
|
|
135
145
|
|---|---|
|
|
136
|
-
| linux-x64-gnu |
|
|
137
|
-
|
|
|
138
|
-
|
|
|
146
|
+
| linux-x64-gnu, linux-arm64-gnu | native build and full binding tests in Linux CI |
|
|
147
|
+
| darwin-x64, darwin-arm64 | native build and full binding tests in macOS CI |
|
|
148
|
+
| linux-x64-musl | native musl build and full binding tests on Alpine |
|
|
149
|
+
| win32-x64-msvc | native MSVC build and full binding tests on Windows |
|
|
150
|
+
|
|
151
|
+
Node 18 or newer is required. `npm install pagesift` selects the matching optional native package;
|
|
152
|
+
Linux musl and glibc packages are separate. Windows supports conversion and HTTP scraping;
|
|
153
|
+
local browser process management is unavailable. The Rust CDP client can connect to an existing remote endpoint.
|
|
139
154
|
|
|
140
155
|
## Development
|
|
141
156
|
|
package/index.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ export interface PageMetadata {
|
|
|
71
71
|
export interface PagesiftMetadata {
|
|
72
72
|
/** Markdown、原始 HTML、正文纯文本的 BLAKE3 哈希(十六进制)。 */
|
|
73
73
|
contentHash?: string
|
|
74
|
+
/** Computed only when change tracking is enabled in a supporting API surface. */
|
|
74
75
|
rawHash?: string
|
|
75
76
|
textHash?: string
|
|
76
77
|
redirectChain?: string[]
|
|
@@ -200,8 +201,9 @@ export declare function convert(html: string | Uint8Array, options?: ConvertOpti
|
|
|
200
201
|
export declare function convertAsync(html: string | Uint8Array, options?: ConvertOptions): Promise<Page>
|
|
201
202
|
|
|
202
203
|
/**
|
|
203
|
-
*
|
|
204
|
-
*
|
|
204
|
+
* 批量转换:使用共享的 Rust CPU 名额,结果顺序和输入一致。
|
|
205
|
+
* 先完成主线程上的输入校验和字符串复制,再启动 CPU 工作,避免输入复制与解析争用 CPU。
|
|
206
|
+
* `Uint8Array` 省去 UTF-8 字符串复制;调用完成前不得修改它。
|
|
205
207
|
*/
|
|
206
208
|
export declare function convertMany(htmls: Array<string | Uint8Array>, options?: ConvertOptions): Promise<Page[]>
|
|
207
209
|
|
package/index.js
CHANGED
|
@@ -89,8 +89,8 @@ function requireNative() {
|
|
|
89
89
|
try {
|
|
90
90
|
const binding = require('pagesift-android-arm64')
|
|
91
91
|
const bindingPackageVersion = require('pagesift-android-arm64/package.json').version
|
|
92
|
-
if (bindingPackageVersion !== '0.0
|
|
93
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
92
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
94
94
|
}
|
|
95
95
|
return binding
|
|
96
96
|
} catch (e) {
|
|
@@ -105,8 +105,8 @@ function requireNative() {
|
|
|
105
105
|
try {
|
|
106
106
|
const binding = require('pagesift-android-arm-eabi')
|
|
107
107
|
const bindingPackageVersion = require('pagesift-android-arm-eabi/package.json').version
|
|
108
|
-
if (bindingPackageVersion !== '0.0
|
|
109
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
108
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
110
110
|
}
|
|
111
111
|
return binding
|
|
112
112
|
} catch (e) {
|
|
@@ -126,8 +126,8 @@ function requireNative() {
|
|
|
126
126
|
try {
|
|
127
127
|
const binding = require('pagesift-win32-x64-gnu')
|
|
128
128
|
const bindingPackageVersion = require('pagesift-win32-x64-gnu/package.json').version
|
|
129
|
-
if (bindingPackageVersion !== '0.0
|
|
130
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
129
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
131
131
|
}
|
|
132
132
|
return binding
|
|
133
133
|
} catch (e) {
|
|
@@ -142,8 +142,8 @@ function requireNative() {
|
|
|
142
142
|
try {
|
|
143
143
|
const binding = require('pagesift-win32-x64-msvc')
|
|
144
144
|
const bindingPackageVersion = require('pagesift-win32-x64-msvc/package.json').version
|
|
145
|
-
if (bindingPackageVersion !== '0.0
|
|
146
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
145
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
147
147
|
}
|
|
148
148
|
return binding
|
|
149
149
|
} catch (e) {
|
|
@@ -159,8 +159,8 @@ function requireNative() {
|
|
|
159
159
|
try {
|
|
160
160
|
const binding = require('pagesift-win32-ia32-msvc')
|
|
161
161
|
const bindingPackageVersion = require('pagesift-win32-ia32-msvc/package.json').version
|
|
162
|
-
if (bindingPackageVersion !== '0.0
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
162
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
164
164
|
}
|
|
165
165
|
return binding
|
|
166
166
|
} catch (e) {
|
|
@@ -175,8 +175,8 @@ function requireNative() {
|
|
|
175
175
|
try {
|
|
176
176
|
const binding = require('pagesift-win32-arm64-msvc')
|
|
177
177
|
const bindingPackageVersion = require('pagesift-win32-arm64-msvc/package.json').version
|
|
178
|
-
if (bindingPackageVersion !== '0.0
|
|
179
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
178
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
180
180
|
}
|
|
181
181
|
return binding
|
|
182
182
|
} catch (e) {
|
|
@@ -194,8 +194,8 @@ function requireNative() {
|
|
|
194
194
|
try {
|
|
195
195
|
const binding = require('pagesift-darwin-universal')
|
|
196
196
|
const bindingPackageVersion = require('pagesift-darwin-universal/package.json').version
|
|
197
|
-
if (bindingPackageVersion !== '0.0
|
|
198
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
197
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
199
199
|
}
|
|
200
200
|
return binding
|
|
201
201
|
} catch (e) {
|
|
@@ -210,8 +210,8 @@ function requireNative() {
|
|
|
210
210
|
try {
|
|
211
211
|
const binding = require('pagesift-darwin-x64')
|
|
212
212
|
const bindingPackageVersion = require('pagesift-darwin-x64/package.json').version
|
|
213
|
-
if (bindingPackageVersion !== '0.0
|
|
214
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
213
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
215
215
|
}
|
|
216
216
|
return binding
|
|
217
217
|
} catch (e) {
|
|
@@ -226,8 +226,8 @@ function requireNative() {
|
|
|
226
226
|
try {
|
|
227
227
|
const binding = require('pagesift-darwin-arm64')
|
|
228
228
|
const bindingPackageVersion = require('pagesift-darwin-arm64/package.json').version
|
|
229
|
-
if (bindingPackageVersion !== '0.0
|
|
230
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
229
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
231
231
|
}
|
|
232
232
|
return binding
|
|
233
233
|
} catch (e) {
|
|
@@ -246,8 +246,8 @@ function requireNative() {
|
|
|
246
246
|
try {
|
|
247
247
|
const binding = require('pagesift-freebsd-x64')
|
|
248
248
|
const bindingPackageVersion = require('pagesift-freebsd-x64/package.json').version
|
|
249
|
-
if (bindingPackageVersion !== '0.0
|
|
250
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
249
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
251
251
|
}
|
|
252
252
|
return binding
|
|
253
253
|
} catch (e) {
|
|
@@ -262,8 +262,8 @@ function requireNative() {
|
|
|
262
262
|
try {
|
|
263
263
|
const binding = require('pagesift-freebsd-arm64')
|
|
264
264
|
const bindingPackageVersion = require('pagesift-freebsd-arm64/package.json').version
|
|
265
|
-
if (bindingPackageVersion !== '0.0
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
265
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
267
267
|
}
|
|
268
268
|
return binding
|
|
269
269
|
} catch (e) {
|
|
@@ -283,8 +283,8 @@ function requireNative() {
|
|
|
283
283
|
try {
|
|
284
284
|
const binding = require('pagesift-linux-x64-musl')
|
|
285
285
|
const bindingPackageVersion = require('pagesift-linux-x64-musl/package.json').version
|
|
286
|
-
if (bindingPackageVersion !== '0.0
|
|
287
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
286
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
288
288
|
}
|
|
289
289
|
return binding
|
|
290
290
|
} catch (e) {
|
|
@@ -299,8 +299,8 @@ function requireNative() {
|
|
|
299
299
|
try {
|
|
300
300
|
const binding = require('pagesift-linux-x64-gnu')
|
|
301
301
|
const bindingPackageVersion = require('pagesift-linux-x64-gnu/package.json').version
|
|
302
|
-
if (bindingPackageVersion !== '0.0
|
|
303
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
302
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
304
304
|
}
|
|
305
305
|
return binding
|
|
306
306
|
} catch (e) {
|
|
@@ -317,8 +317,8 @@ function requireNative() {
|
|
|
317
317
|
try {
|
|
318
318
|
const binding = require('pagesift-linux-arm64-musl')
|
|
319
319
|
const bindingPackageVersion = require('pagesift-linux-arm64-musl/package.json').version
|
|
320
|
-
if (bindingPackageVersion !== '0.0
|
|
321
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
320
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
322
322
|
}
|
|
323
323
|
return binding
|
|
324
324
|
} catch (e) {
|
|
@@ -333,8 +333,8 @@ function requireNative() {
|
|
|
333
333
|
try {
|
|
334
334
|
const binding = require('pagesift-linux-arm64-gnu')
|
|
335
335
|
const bindingPackageVersion = require('pagesift-linux-arm64-gnu/package.json').version
|
|
336
|
-
if (bindingPackageVersion !== '0.0
|
|
337
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
336
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
338
338
|
}
|
|
339
339
|
return binding
|
|
340
340
|
} catch (e) {
|
|
@@ -351,8 +351,8 @@ function requireNative() {
|
|
|
351
351
|
try {
|
|
352
352
|
const binding = require('pagesift-linux-arm-musleabihf')
|
|
353
353
|
const bindingPackageVersion = require('pagesift-linux-arm-musleabihf/package.json').version
|
|
354
|
-
if (bindingPackageVersion !== '0.0
|
|
355
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
354
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
356
356
|
}
|
|
357
357
|
return binding
|
|
358
358
|
} catch (e) {
|
|
@@ -367,8 +367,8 @@ function requireNative() {
|
|
|
367
367
|
try {
|
|
368
368
|
const binding = require('pagesift-linux-arm-gnueabihf')
|
|
369
369
|
const bindingPackageVersion = require('pagesift-linux-arm-gnueabihf/package.json').version
|
|
370
|
-
if (bindingPackageVersion !== '0.0
|
|
371
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
370
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
372
372
|
}
|
|
373
373
|
return binding
|
|
374
374
|
} catch (e) {
|
|
@@ -385,8 +385,8 @@ function requireNative() {
|
|
|
385
385
|
try {
|
|
386
386
|
const binding = require('pagesift-linux-loong64-musl')
|
|
387
387
|
const bindingPackageVersion = require('pagesift-linux-loong64-musl/package.json').version
|
|
388
|
-
if (bindingPackageVersion !== '0.0
|
|
389
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
388
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
390
390
|
}
|
|
391
391
|
return binding
|
|
392
392
|
} catch (e) {
|
|
@@ -401,8 +401,8 @@ function requireNative() {
|
|
|
401
401
|
try {
|
|
402
402
|
const binding = require('pagesift-linux-loong64-gnu')
|
|
403
403
|
const bindingPackageVersion = require('pagesift-linux-loong64-gnu/package.json').version
|
|
404
|
-
if (bindingPackageVersion !== '0.0
|
|
405
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
404
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
406
406
|
}
|
|
407
407
|
return binding
|
|
408
408
|
} catch (e) {
|
|
@@ -419,8 +419,8 @@ function requireNative() {
|
|
|
419
419
|
try {
|
|
420
420
|
const binding = require('pagesift-linux-riscv64-musl')
|
|
421
421
|
const bindingPackageVersion = require('pagesift-linux-riscv64-musl/package.json').version
|
|
422
|
-
if (bindingPackageVersion !== '0.0
|
|
423
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
422
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
424
424
|
}
|
|
425
425
|
return binding
|
|
426
426
|
} catch (e) {
|
|
@@ -435,8 +435,8 @@ function requireNative() {
|
|
|
435
435
|
try {
|
|
436
436
|
const binding = require('pagesift-linux-riscv64-gnu')
|
|
437
437
|
const bindingPackageVersion = require('pagesift-linux-riscv64-gnu/package.json').version
|
|
438
|
-
if (bindingPackageVersion !== '0.0
|
|
439
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
438
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
440
440
|
}
|
|
441
441
|
return binding
|
|
442
442
|
} catch (e) {
|
|
@@ -452,8 +452,8 @@ function requireNative() {
|
|
|
452
452
|
try {
|
|
453
453
|
const binding = require('pagesift-linux-ppc64-gnu')
|
|
454
454
|
const bindingPackageVersion = require('pagesift-linux-ppc64-gnu/package.json').version
|
|
455
|
-
if (bindingPackageVersion !== '0.0
|
|
456
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
455
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
457
457
|
}
|
|
458
458
|
return binding
|
|
459
459
|
} catch (e) {
|
|
@@ -468,8 +468,8 @@ function requireNative() {
|
|
|
468
468
|
try {
|
|
469
469
|
const binding = require('pagesift-linux-s390x-gnu')
|
|
470
470
|
const bindingPackageVersion = require('pagesift-linux-s390x-gnu/package.json').version
|
|
471
|
-
if (bindingPackageVersion !== '0.0
|
|
472
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
471
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
473
473
|
}
|
|
474
474
|
return binding
|
|
475
475
|
} catch (e) {
|
|
@@ -488,8 +488,8 @@ function requireNative() {
|
|
|
488
488
|
try {
|
|
489
489
|
const binding = require('pagesift-openharmony-arm64')
|
|
490
490
|
const bindingPackageVersion = require('pagesift-openharmony-arm64/package.json').version
|
|
491
|
-
if (bindingPackageVersion !== '0.0
|
|
492
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
491
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
493
493
|
}
|
|
494
494
|
return binding
|
|
495
495
|
} catch (e) {
|
|
@@ -504,8 +504,8 @@ function requireNative() {
|
|
|
504
504
|
try {
|
|
505
505
|
const binding = require('pagesift-openharmony-x64')
|
|
506
506
|
const bindingPackageVersion = require('pagesift-openharmony-x64/package.json').version
|
|
507
|
-
if (bindingPackageVersion !== '0.0
|
|
508
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
507
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
509
509
|
}
|
|
510
510
|
return binding
|
|
511
511
|
} catch (e) {
|
|
@@ -520,8 +520,8 @@ function requireNative() {
|
|
|
520
520
|
try {
|
|
521
521
|
const binding = require('pagesift-openharmony-arm')
|
|
522
522
|
const bindingPackageVersion = require('pagesift-openharmony-arm/package.json').version
|
|
523
|
-
if (bindingPackageVersion !== '0.0
|
|
524
|
-
throw new Error(`Native binding package version mismatch, expected 0.0
|
|
523
|
+
if (bindingPackageVersion !== '0.20.0' && 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 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
525
525
|
}
|
|
526
526
|
return binding
|
|
527
527
|
} catch (e) {
|
|
@@ -661,8 +661,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
661
661
|
if (!candidateFailed) {
|
|
662
662
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
663
663
|
const bindingPackageVersion = require('pagesift-wasm32-wasi/package.json').version
|
|
664
|
-
if (bindingPackageVersion !== '0.0
|
|
665
|
-
throw new Error(`WASI binding package version mismatch, expected 0.0
|
|
664
|
+
if (bindingPackageVersion !== '0.20.0') {
|
|
665
|
+
throw new Error(`WASI binding package version mismatch, expected 0.20.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
wasiBinding = require('pagesift-wasm32-wasi')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pagesift",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Turn web pages into clean Markdown for LLMs: a polite, Firecrawl-compatible scraping engine written in Rust.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -32,14 +32,16 @@
|
|
|
32
32
|
"x86_64-unknown-linux-gnu",
|
|
33
33
|
"aarch64-unknown-linux-gnu",
|
|
34
34
|
"x86_64-apple-darwin",
|
|
35
|
-
"aarch64-apple-darwin"
|
|
35
|
+
"aarch64-apple-darwin",
|
|
36
|
+
"x86_64-unknown-linux-musl",
|
|
37
|
+
"x86_64-pc-windows-msvc"
|
|
36
38
|
],
|
|
37
39
|
"dtsHeaderFile": "header.d.ts"
|
|
38
40
|
},
|
|
39
41
|
"scripts": {
|
|
40
42
|
"build": "napi build --platform --release && node scripts/postbuild.mjs",
|
|
41
43
|
"build:debug": "napi build --platform && node scripts/postbuild.mjs",
|
|
42
|
-
"test": "node --test",
|
|
44
|
+
"test": "node --test --test-concurrency=1",
|
|
43
45
|
"bench": "node bench/bench.mjs",
|
|
44
46
|
"artifacts": "napi artifacts",
|
|
45
47
|
"prepublishOnly": "napi prepublish -t npm --no-gh-release",
|
|
@@ -49,9 +51,11 @@
|
|
|
49
51
|
"@napi-rs/cli": "3.10.8"
|
|
50
52
|
},
|
|
51
53
|
"optionalDependencies": {
|
|
52
|
-
"pagesift-
|
|
53
|
-
"pagesift-
|
|
54
|
-
"pagesift-
|
|
55
|
-
"pagesift-
|
|
54
|
+
"pagesift-darwin-arm64": "0.20.0",
|
|
55
|
+
"pagesift-darwin-x64": "0.20.0",
|
|
56
|
+
"pagesift-linux-arm64-gnu": "0.20.0",
|
|
57
|
+
"pagesift-linux-x64-gnu": "0.20.0",
|
|
58
|
+
"pagesift-linux-x64-musl": "0.20.0",
|
|
59
|
+
"pagesift-win32-x64-msvc": "0.20.0"
|
|
56
60
|
}
|
|
57
61
|
}
|