node-poppler 6.2.0 → 6.2.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.
- package/package.json +2 -1
- package/src/index.js +23 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-poppler",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.2",
|
|
4
4
|
"description": "Asynchronous node.js wrapper for the Poppler PDF rendering library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"async",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"author": "Frazer Smith <frazer.dev@outlook.com>",
|
|
44
|
+
"funding": "https://github.com/sponsors/Fdawgs",
|
|
44
45
|
"engines": {
|
|
45
46
|
"node": ">=14.0.0"
|
|
46
47
|
},
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable security/detect-child-process */
|
|
2
1
|
const camelCase = require("camelcase");
|
|
3
2
|
const path = require("upath");
|
|
4
3
|
const { execFile, spawn } = require("child_process");
|
|
@@ -236,15 +235,15 @@ class Poppler {
|
|
|
236
235
|
let stdOut = "";
|
|
237
236
|
let stdErr = "";
|
|
238
237
|
|
|
239
|
-
child.stdout.on("data",
|
|
238
|
+
child.stdout.on("data", (data) => {
|
|
240
239
|
stdOut += data;
|
|
241
240
|
});
|
|
242
241
|
|
|
243
|
-
child.stderr.on("data",
|
|
242
|
+
child.stderr.on("data", (data) => {
|
|
244
243
|
stdErr += data;
|
|
245
244
|
});
|
|
246
245
|
|
|
247
|
-
child.on("close",
|
|
246
|
+
child.on("close", () => {
|
|
248
247
|
if (stdOut !== "") {
|
|
249
248
|
resolve(stdOut.trim());
|
|
250
249
|
} else {
|
|
@@ -332,15 +331,15 @@ class Poppler {
|
|
|
332
331
|
let stdOut = "";
|
|
333
332
|
let stdErr = "";
|
|
334
333
|
|
|
335
|
-
child.stdout.on("data",
|
|
334
|
+
child.stdout.on("data", (data) => {
|
|
336
335
|
stdOut += data;
|
|
337
336
|
});
|
|
338
337
|
|
|
339
|
-
child.stderr.on("data",
|
|
338
|
+
child.stderr.on("data", (data) => {
|
|
340
339
|
stdErr += data;
|
|
341
340
|
});
|
|
342
341
|
|
|
343
|
-
child.on("close",
|
|
342
|
+
child.on("close", (code) => {
|
|
344
343
|
if (stdOut !== "") {
|
|
345
344
|
resolve(stdOut.trim());
|
|
346
345
|
} else if (code === 0) {
|
|
@@ -450,15 +449,15 @@ class Poppler {
|
|
|
450
449
|
let stdOut = "";
|
|
451
450
|
let stdErr = "";
|
|
452
451
|
|
|
453
|
-
child.stdout.on("data",
|
|
452
|
+
child.stdout.on("data", (data) => {
|
|
454
453
|
stdOut += data;
|
|
455
454
|
});
|
|
456
455
|
|
|
457
|
-
child.stderr.on("data",
|
|
456
|
+
child.stderr.on("data", (data) => {
|
|
458
457
|
stdErr += data;
|
|
459
458
|
});
|
|
460
459
|
|
|
461
|
-
child.on("close",
|
|
460
|
+
child.on("close", () => {
|
|
462
461
|
if (stdOut !== "") {
|
|
463
462
|
if (fileSize) {
|
|
464
463
|
stdOut = stdOut.replace(
|
|
@@ -737,15 +736,15 @@ class Poppler {
|
|
|
737
736
|
let stdOut = "";
|
|
738
737
|
let stdErr = "";
|
|
739
738
|
|
|
740
|
-
child.stdout.on("data",
|
|
739
|
+
child.stdout.on("data", (data) => {
|
|
741
740
|
stdOut += data;
|
|
742
741
|
});
|
|
743
742
|
|
|
744
|
-
child.stderr.on("data",
|
|
743
|
+
child.stderr.on("data", (data) => {
|
|
745
744
|
stdErr += data;
|
|
746
745
|
});
|
|
747
746
|
|
|
748
|
-
child.on("close",
|
|
747
|
+
child.on("close", (code) => {
|
|
749
748
|
if (stdOut !== "") {
|
|
750
749
|
resolve(stdOut.trim());
|
|
751
750
|
} else if (code === 0) {
|
|
@@ -868,11 +867,11 @@ class Poppler {
|
|
|
868
867
|
let stdOut = "";
|
|
869
868
|
let stdErr = "";
|
|
870
869
|
|
|
871
|
-
child.stdout.on("data",
|
|
870
|
+
child.stdout.on("data", (data) => {
|
|
872
871
|
stdOut += data;
|
|
873
872
|
});
|
|
874
873
|
|
|
875
|
-
child.stderr.on("data",
|
|
874
|
+
child.stderr.on("data", (data) => {
|
|
876
875
|
stdErr += data;
|
|
877
876
|
});
|
|
878
877
|
|
|
@@ -880,7 +879,7 @@ class Poppler {
|
|
|
880
879
|
* pdfToHtml does not return an exit code so check output to see if it was successful.
|
|
881
880
|
* See https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/utils/pdftohtml.1
|
|
882
881
|
*/
|
|
883
|
-
child.on("close",
|
|
882
|
+
child.on("close", () => {
|
|
884
883
|
if (stdOut !== "") {
|
|
885
884
|
resolve(stdOut.trim());
|
|
886
885
|
} else {
|
|
@@ -1069,11 +1068,11 @@ class Poppler {
|
|
|
1069
1068
|
|
|
1070
1069
|
let stdErr = "";
|
|
1071
1070
|
|
|
1072
|
-
child.stderr.on("data",
|
|
1071
|
+
child.stderr.on("data", (data) => {
|
|
1073
1072
|
stdErr += data;
|
|
1074
1073
|
});
|
|
1075
1074
|
|
|
1076
|
-
child.on("close",
|
|
1075
|
+
child.on("close", (code) => {
|
|
1077
1076
|
if (stdErr !== "") {
|
|
1078
1077
|
reject(new Error(stdErr.trim()));
|
|
1079
1078
|
} else if (code === 0) {
|
|
@@ -1304,15 +1303,15 @@ class Poppler {
|
|
|
1304
1303
|
let stdOut = "";
|
|
1305
1304
|
let stdErr = "";
|
|
1306
1305
|
|
|
1307
|
-
child.stdout.on("data",
|
|
1306
|
+
child.stdout.on("data", (data) => {
|
|
1308
1307
|
stdOut += data;
|
|
1309
1308
|
});
|
|
1310
1309
|
|
|
1311
|
-
child.stderr.on("data",
|
|
1310
|
+
child.stderr.on("data", (data) => {
|
|
1312
1311
|
stdErr += data;
|
|
1313
1312
|
});
|
|
1314
1313
|
|
|
1315
|
-
child.on("close",
|
|
1314
|
+
child.on("close", (code) => {
|
|
1316
1315
|
if (stdOut !== "") {
|
|
1317
1316
|
resolve(stdOut.trim());
|
|
1318
1317
|
} else if (code === 0) {
|
|
@@ -1453,15 +1452,15 @@ class Poppler {
|
|
|
1453
1452
|
let stdOut = "";
|
|
1454
1453
|
let stdErr = "";
|
|
1455
1454
|
|
|
1456
|
-
child.stdout.on("data",
|
|
1455
|
+
child.stdout.on("data", (data) => {
|
|
1457
1456
|
stdOut += data;
|
|
1458
1457
|
});
|
|
1459
1458
|
|
|
1460
|
-
child.stderr.on("data",
|
|
1459
|
+
child.stderr.on("data", (data) => {
|
|
1461
1460
|
stdErr += data;
|
|
1462
1461
|
});
|
|
1463
1462
|
|
|
1464
|
-
child.on("close",
|
|
1463
|
+
child.on("close", (code) => {
|
|
1465
1464
|
if (stdOut !== "") {
|
|
1466
1465
|
resolve(stdOut.trim());
|
|
1467
1466
|
} else if (code === 0) {
|