From befdf296e6649b3fc1b932a216c8a8e435b6a100 Mon Sep 17 00:00:00 2001
From: Balearica <admin@scribeocr.com>
Date: Wed, 27 Sep 2023 23:52:51 -0700
Subject: [PATCH 1/2] Removed node prefix to restore compatability with Node.js
 v14

---
 benchmarks/node/speed-benchmark.js | 2 +-
 examples/node/detect.js            | 2 +-
 examples/node/download-pdf.js      | 4 ++--
 examples/node/image-processing.js  | 4 ++--
 examples/node/recognize.js         | 2 +-
 scripts/server.js                  | 2 +-
 scripts/test-helper.js             | 4 ++--
 scripts/webpack.config.dev.js      | 2 +-
 scripts/webpack.config.prod.js     | 2 +-
 src/worker-script/node/cache.js    | 4 ++--
 src/worker-script/node/gunzip.js   | 2 +-
 src/worker-script/node/index.js    | 2 +-
 src/worker/node/defaultOptions.js  | 2 +-
 src/worker/node/loadImage.js       | 4 ++--
 src/worker/node/spawnWorker.js     | 2 +-
 15 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/benchmarks/node/speed-benchmark.js b/benchmarks/node/speed-benchmark.js
index 68ebd29c..28d3fe72 100644
--- a/benchmarks/node/speed-benchmark.js
+++ b/benchmarks/node/speed-benchmark.js
@@ -1,5 +1,5 @@
 #!/usr/bin/env node
-const path = require('node:path');
+const path = require('path');
 const { createWorker } = require('../../');
 
 (async () => {
diff --git a/examples/node/detect.js b/examples/node/detect.js
index 8f11608e..a3e112a1 100755
--- a/examples/node/detect.js
+++ b/examples/node/detect.js
@@ -1,5 +1,5 @@
 #!/usr/bin/env node
-const path = require('node:path');
+const path = require('path');
 const Tesseract = require('../../');
 
 const [,, imagePath] = process.argv;
diff --git a/examples/node/download-pdf.js b/examples/node/download-pdf.js
index f12d8174..3c459973 100755
--- a/examples/node/download-pdf.js
+++ b/examples/node/download-pdf.js
@@ -1,6 +1,6 @@
 #!/usr/bin/env node
-const path = require('node:path');
-const fs = require('node:fs');
+const path = require('path');
+const fs = require('fs');
 const { createWorker } = require('../../');
 
 const [,, imagePath] = process.argv;
diff --git a/examples/node/image-processing.js b/examples/node/image-processing.js
index 9de7d9ab..e4297a9f 100755
--- a/examples/node/image-processing.js
+++ b/examples/node/image-processing.js
@@ -1,6 +1,6 @@
 #!/usr/bin/env node
-const path = require('node:path');
-const fs = require('node:fs');
+const path = require('path');
+const fs = require('fs');
 const { createWorker } = require('../../');
 
 const [,, imagePath] = process.argv;
diff --git a/examples/node/recognize.js b/examples/node/recognize.js
index a01b333e..082ffa0c 100755
--- a/examples/node/recognize.js
+++ b/examples/node/recognize.js
@@ -1,5 +1,5 @@
 #!/usr/bin/env node
-const path = require('node:path');
+const path = require('path');
 const { createWorker } = require('../../');
 
 const [,, imagePath] = process.argv;
diff --git a/scripts/server.js b/scripts/server.js
index a53052a0..8e857f5f 100644
--- a/scripts/server.js
+++ b/scripts/server.js
@@ -1,7 +1,7 @@
 const webpack = require('webpack');
 const middleware = require('webpack-dev-middleware');
 const express = require('express');
-const path = require('node:path');
+const path = require('path');
 const cors = require('cors');
 const webpackConfig = require('./webpack.config.dev');
 
diff --git a/scripts/test-helper.js b/scripts/test-helper.js
index 3a2b3975..027b3006 100644
--- a/scripts/test-helper.js
+++ b/scripts/test-helper.js
@@ -1,7 +1,7 @@
 const constants = require('../tests/constants');
 global.expect = require('expect.js');
-global.fs = require('node:fs');
-global.path = require('node:path');
+global.fs = require('fs');
+global.path = require('path');
 global.Tesseract = require('../src');
 
 Object.keys(constants).forEach((key) => {
diff --git a/scripts/webpack.config.dev.js b/scripts/webpack.config.dev.js
index d218c55a..e807f43d 100644
--- a/scripts/webpack.config.dev.js
+++ b/scripts/webpack.config.dev.js
@@ -1,4 +1,4 @@
-const path = require('node:path');
+const path = require('path');
 const webpack = require('webpack');
 const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
 const common = require('./webpack.config.common');
diff --git a/scripts/webpack.config.prod.js b/scripts/webpack.config.prod.js
index b92d5e3a..e581df7a 100644
--- a/scripts/webpack.config.prod.js
+++ b/scripts/webpack.config.prod.js
@@ -1,4 +1,4 @@
-const path = require('node:path');
+const path = require('path');
 const common = require('./webpack.config.common');
 const webpack = require('webpack');
 
diff --git a/src/worker-script/node/cache.js b/src/worker-script/node/cache.js
index fd6bab6b..e04809e2 100644
--- a/src/worker-script/node/cache.js
+++ b/src/worker-script/node/cache.js
@@ -1,5 +1,5 @@
-const util = require('node:util');
-const fs = require('node:fs');
+const util = require('util');
+const fs = require('fs');
 
 module.exports = {
   readCache: util.promisify(fs.readFile),
diff --git a/src/worker-script/node/gunzip.js b/src/worker-script/node/gunzip.js
index 40f32949..4f2e0e0c 100644
--- a/src/worker-script/node/gunzip.js
+++ b/src/worker-script/node/gunzip.js
@@ -1 +1 @@
-module.exports = require('node:zlib').gunzipSync;
+module.exports = require('zlib').gunzipSync;
diff --git a/src/worker-script/node/index.js b/src/worker-script/node/index.js
index fb187b05..c00dba73 100644
--- a/src/worker-script/node/index.js
+++ b/src/worker-script/node/index.js
@@ -9,7 +9,7 @@
  */
 
 const fetch = require('node-fetch');
-const { parentPort } = require('node:worker_threads');
+const { parentPort } = require('worker_threads');
 const worker = require('..');
 const getCore = require('./getCore');
 const gunzip = require('./gunzip');
diff --git a/src/worker/node/defaultOptions.js b/src/worker/node/defaultOptions.js
index 498714c4..053c1e3e 100644
--- a/src/worker/node/defaultOptions.js
+++ b/src/worker/node/defaultOptions.js
@@ -1,4 +1,4 @@
-const path = require('node:path');
+const path = require('path');
 const defaultOptions = require('../../constants/defaultOptions');
 
 /*
diff --git a/src/worker/node/loadImage.js b/src/worker/node/loadImage.js
index 07d684e8..0b5a660f 100644
--- a/src/worker/node/loadImage.js
+++ b/src/worker/node/loadImage.js
@@ -1,5 +1,5 @@
-const util = require('node:util');
-const fs = require('node:fs');
+const util = require('util');
+const fs = require('fs');
 const fetch = require('node-fetch');
 const isURL = require('is-url');
 
diff --git a/src/worker/node/spawnWorker.js b/src/worker/node/spawnWorker.js
index c26537d1..9723c183 100644
--- a/src/worker/node/spawnWorker.js
+++ b/src/worker/node/spawnWorker.js
@@ -1,4 +1,4 @@
-const { Worker } = require('node:worker_threads');
+const { Worker } = require('worker_threads');
 
 /**
  * spawnWorker

From 0af35fa940cc9e665209d6488541a11fd7dcdcbe Mon Sep 17 00:00:00 2001
From: Balearica <admin@scribeocr.com>
Date: Wed, 27 Sep 2023 23:53:33 -0700
Subject: [PATCH 2/2] 4.1.4

---
 package-lock.json | 2 +-
 package.json      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 4238da2f..c6094fc9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "tesseract.js",
-  "version": "4.1.3",
+  "version": "4.1.4",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
diff --git a/package.json b/package.json
index 7d44a2c0..f83b8dc5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "tesseract.js",
-  "version": "4.1.3",
+  "version": "4.1.4",
   "description": "Pure Javascript Multilingual OCR",
   "main": "src/index.js",
   "types": "src/index.d.ts",
