tesseract.js
Advanced tools
Comparing version 4.1.2 to 4.1.3
@@ -35,3 +35,4 @@ # API | ||
- `options` an object of customized options | ||
- `corePath` path for tesseract-core.js script | ||
- `corePath` path to a directory containing **both** `tesseract-core.wasm.js` and `tesseract-core-simd.wasm.js` from [Tesseract.js-core](https://www.npmjs.com/package/tesseract.js-core) package | ||
- Setting `corePath` to a specific `.js` file is **strongly discouraged.** To provide the best performance on all devices, Tesseract.js needs to be able to pick between `tesseract-core.wasm.js` and `tesseract-core-simd.wasm.js`. See [this issue](https://github.com/naptha/tesseract.js/issues/735) for more detail. | ||
- `langPath` path for downloading traineddata, do not include `/` at the end of the path | ||
@@ -38,0 +39,0 @@ - `workerPath` path for downloading worker script |
#!/usr/bin/env node | ||
const path = require('path'); | ||
const path = require('node:path'); | ||
const Tesseract = require('../../'); | ||
@@ -4,0 +4,0 @@ |
#!/usr/bin/env node | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const path = require('node:path'); | ||
const fs = require('node:fs'); | ||
const { createWorker } = require('../../'); | ||
@@ -5,0 +5,0 @@ |
#!/usr/bin/env node | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const path = require('node:path'); | ||
const fs = require('node:fs'); | ||
const { createWorker } = require('../../'); | ||
@@ -5,0 +5,0 @@ |
#!/usr/bin/env node | ||
const path = require('path'); | ||
const path = require('node:path'); | ||
const { createWorker } = require('../../'); | ||
@@ -4,0 +4,0 @@ |
{ | ||
"name": "tesseract.js", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"description": "Pure Javascript Multilingual OCR", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
const webpack = require('webpack'); | ||
const middleware = require('webpack-dev-middleware'); | ||
const express = require('express'); | ||
const path = require('path'); | ||
const path = require('node:path'); | ||
const cors = require('cors'); | ||
@@ -6,0 +6,0 @@ const webpackConfig = require('./webpack.config.dev'); |
const constants = require('../tests/constants'); | ||
global.expect = require('expect.js'); | ||
global.fs = require('fs'); | ||
global.path = require('path'); | ||
global.fs = require('node:fs'); | ||
global.path = require('node:path'); | ||
global.Tesseract = require('../src'); | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
const path = require('path'); | ||
const path = require('node:path'); | ||
const webpack = require('webpack'); | ||
@@ -3,0 +3,0 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); |
@@ -1,2 +0,2 @@ | ||
const path = require('path'); | ||
const path = require('node:path'); | ||
const common = require('./webpack.config.common'); | ||
@@ -3,0 +3,0 @@ const webpack = require('webpack'); |
@@ -10,3 +10,3 @@ const isElectron = require('is-electron'); | ||
env.type = 'electron'; | ||
} else if (typeof window === 'object') { | ||
} else if (typeof document === 'object') { | ||
env.type = 'browser'; | ||
@@ -13,0 +13,0 @@ } else if (typeof process === 'object' && typeof require === 'function') { |
@@ -1,3 +0,3 @@ | ||
const util = require('util'); | ||
const fs = require('fs'); | ||
const util = require('node:util'); | ||
const fs = require('node:fs'); | ||
@@ -4,0 +4,0 @@ module.exports = { |
@@ -1,1 +0,1 @@ | ||
module.exports = require('zlib').gunzipSync; | ||
module.exports = require('node:zlib').gunzipSync; |
@@ -12,3 +12,3 @@ /** | ||
const fetch = require('node-fetch'); | ||
const { parentPort } = require('worker_threads'); | ||
const { parentPort } = require('node:worker_threads'); | ||
const worker = require('..'); | ||
@@ -15,0 +15,0 @@ const getCore = require('./getCore'); |
@@ -1,2 +0,2 @@ | ||
const path = require('path'); | ||
const path = require('node:path'); | ||
const defaultOptions = require('../../constants/defaultOptions'); | ||
@@ -3,0 +3,0 @@ |
@@ -1,3 +0,3 @@ | ||
const util = require('util'); | ||
const fs = require('fs'); | ||
const util = require('node:util'); | ||
const fs = require('node:fs'); | ||
const fetch = require('node-fetch'); | ||
@@ -4,0 +4,0 @@ const isURL = require('is-url'); |
@@ -1,2 +0,2 @@ | ||
const { Worker } = require('worker_threads'); | ||
const { Worker } = require('node:worker_threads'); | ||
@@ -3,0 +3,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1447787
1