tesseract.js-utils
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0-beta.6
{ | ||
"name": "tesseract.js-utils", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0-beta.6", | ||
"description": "Utilities for tesseract.js", | ||
"main": "src/index.node.js", | ||
"scripts": { | ||
"test:server": "node tests/scripts/server.js", | ||
"test:node": "mocha --exit --bail --require ./tests/scripts/test-helper.js tests/*.test.js", | ||
"test:browser": "testcafe chrome tests/browser/**/*.test.js", | ||
"start": "node ./scripts/server.js", | ||
"wait": "wait-on http://localhost:3000/package.json", | ||
"test": "npm-run-all -p -r start test:all", | ||
"test:all": "npm-run-all wait test:browser:* test:node", | ||
"test:node": "mocha --exit --bail --require ./scripts/test-helper.js tests/*.test.js", | ||
"test:browser-tpl": "mocha-headless-chrome -a incognito -a no-sandbox -a disable-setuid-sandbox -t 300000", | ||
"test:browser:load-lang": "npm run test:browser-tpl -- -f ./tests/loadLang.test.html", | ||
"test:browser:read-image": "npm run test:browser-tpl -- -f ./tests/readImage.test.html", | ||
"lint": "eslint ." | ||
@@ -35,2 +40,3 @@ }, | ||
"devDependencies": { | ||
"cors": "^2.8.5", | ||
"eslint": "^5.9.0", | ||
@@ -46,4 +52,6 @@ "eslint-config-airbnb": "^17.1.0", | ||
"mocha": "^5.2.0", | ||
"mocha-headless-chrome": "^2.0.2", | ||
"npm-run-all": "^4.1.5", | ||
"tesseract.js-core": "^2.0.0-beta.5", | ||
"testcafe": "^0.23.2", | ||
"wait-on": "^3.2.0", | ||
"webpack": "^4.25.1", | ||
@@ -53,2 +61,3 @@ "webpack-dev-middleware": "^3.4.0" | ||
"dependencies": { | ||
"axios": "^0.18.0", | ||
"bmp-js": "^0.1.0", | ||
@@ -58,3 +67,2 @@ "file-type": "^10.5.0", | ||
"is-url": "^1.2.4", | ||
"node-fetch": "^2.3.0", | ||
"resolve-url": "^0.2.1", | ||
@@ -61,0 +69,0 @@ "zlibjs": "^0.3.1" |
@@ -5,3 +5,2 @@ const cache = require('./common/browser/cache'); | ||
loadLang: require('./loadLang')({ | ||
fetch: require('./common/browser/fetch'), | ||
gunzip: require('./common/browser/gunzip'), | ||
@@ -8,0 +7,0 @@ resolveURL: require('resolve-url'), |
@@ -5,3 +5,2 @@ const cache = require('./common/node/cache'); | ||
loadLang: require('./loadLang')({ | ||
fetch: require('./common/node/fetch'), | ||
gunzip: require('./common/node/gunzip'), | ||
@@ -8,0 +7,0 @@ ...cache, |
const isURL = require('is-url'); | ||
const axios = require('axios'); | ||
@@ -50,5 +51,6 @@ const handleLang = modules => ({ | ||
const fetchTrainedData = iLangPath => ( | ||
modules.fetch(`${iLangPath}/${lang}.traineddata.gz`) | ||
.then(resp => resp.arrayBuffer()) | ||
.then(buf => modules.gunzip(new Uint8Array(buf))) | ||
axios.get(`${iLangPath}/${lang}.traineddata.gz`, { | ||
responseType: 'arraybuffer', | ||
}) | ||
.then(resp => modules.gunzip(new Uint8Array(resp.data))) | ||
.then(handleLang(modules)({ | ||
@@ -55,0 +57,0 @@ cachePath, cacheMethod, lang, ...options, |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
7798
0
17
10
187
+ Addedaxios@^0.18.0
+ Addedaxios@0.18.1(transitive)
+ Addedfollow-redirects@1.5.10(transitive)
+ Addedis-buffer@2.0.5(transitive)
- Removednode-fetch@^2.3.0
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)