pdfium-native 0.2.3 → 0.2.4
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 +1 -1
- package/package.json +2 -2
- package/scripts/install.mjs +4 -3
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ doc.destroy();
|
|
|
40
40
|
**🔒 Reliability**
|
|
41
41
|
|
|
42
42
|
- Built on PDFium — the PDF engine used in Chromium
|
|
43
|
-
- ABI-stable via N-API — works across Node.js
|
|
43
|
+
- ABI-stable via N-API — works across Node.js 20–24 without recompilation
|
|
44
44
|
- Password-protected PDFs supported out of the box
|
|
45
45
|
|
|
46
46
|
### 🎯 Use cases
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdfium-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Native Node.js bindings for PDFium",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=20.11.0"
|
|
9
9
|
},
|
|
10
10
|
"keywords": [
|
|
11
11
|
"pdf",
|
package/scripts/install.mjs
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
* Musl (Alpine) naming: pdfium-v{version}-linux-musl-{arch}.tar.gz
|
|
7
7
|
* Contents: build/Release/pdfium.node + build/Release/libpdfium.{dylib,so,dll}
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { execFileSync, execSync } from 'node:child_process';
|
|
10
|
+
import { createWriteStream, existsSync, mkdirSync, readFileSync, unlinkSync } from 'node:fs';
|
|
10
11
|
import { join } from 'node:path';
|
|
11
|
-
import {
|
|
12
|
+
import { Readable } from 'node:stream';
|
|
12
13
|
import { pipeline } from 'node:stream/promises';
|
|
13
14
|
|
|
14
15
|
const root = join(import.meta.dirname, '..');
|
|
@@ -70,7 +71,7 @@ async function tryDownload() {
|
|
|
70
71
|
const body = res.body;
|
|
71
72
|
if (!body) return false;
|
|
72
73
|
|
|
73
|
-
await pipeline(body, fileStream);
|
|
74
|
+
await pipeline(Readable.fromWeb(body), fileStream);
|
|
74
75
|
|
|
75
76
|
// extract tar.gz into project root
|
|
76
77
|
execFileSync('tar', ['xzf', tmpTar, '-C', root], { stdio: 'inherit' });
|