opencv4nodejs-prebuilt
Advanced tools
Comparing version 4.14.1 to 4.15.0-b11
@@ -1,3 +0,2 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const path = require("path"); | ||
@@ -8,11 +7,14 @@ function resolvePath(filePath, file) { | ||
} | ||
return (file ? path.resolve(filePath, file) : path.resolve(filePath)).replace(/\\/g, '/'); | ||
return (file ? path.resolve(filePath, file) : path.resolve(filePath)).replace( | ||
/\\/g, | ||
"/" | ||
); | ||
} | ||
const defaultDir = '/usr/local'; | ||
const defaultDir = "/usr/local"; | ||
function getLibDir() { | ||
const libPath = resolvePath(process.env.OPENCV_LIB_DIR) | ||
if (process.platform === 'win32' && !libPath) { | ||
throw new Error('OPENCV_LIB_DIR is not defined') | ||
const libPath = resolvePath(process.env.OPENCV_LIB_DIR); | ||
if (process.platform === "win32" && !libPath) { | ||
throw new Error("OPENCV_LIB_DIR is not defined"); | ||
} | ||
@@ -22,6 +24,11 @@ return libPath || `${defaultDir}/lib`; | ||
function linkSystemLibs() { | ||
return !!process.env.OPENCV_LINK_SYSTEM_LIBS; | ||
} | ||
module.exports = { | ||
resolvePath, | ||
defaultDir, | ||
getLibDir | ||
getLibDir, | ||
linkSystemLibs | ||
}; |
const path = require('path'); | ||
const opencvBuild = require('opencv-build'); | ||
const opencvBuild = require(`@nut-tree/opencv-build-${process.platform}`); | ||
const { resolvePath } = require('./commons'); | ||
// ensure binaries are added to path on windows | ||
if (!opencvBuild.isAutoBuildDisabled() && process.platform === 'win32') { | ||
if (process.platform === 'win32') { | ||
// append opencv binary path to node process | ||
@@ -27,2 +27,2 @@ if (!process.env.path.includes(opencvBuild.opencvBinDir)) { | ||
module.exports = cv; | ||
module.exports = cv; |
@@ -1,5 +0,5 @@ | ||
const opencvBuild = require('opencv-build'); | ||
const { getLibDir } = require('./commons'); | ||
const opencvBuild = require(`@nut-tree/opencv-build-${process.platform}`); | ||
const { getLibDir, linkSystemLibs } = require('./commons'); | ||
if (opencvBuild.isAutoBuildDisabled()) { | ||
if (linkSystemLibs()) { | ||
opencvBuild.getLibs(getLibDir()) | ||
@@ -14,2 +14,2 @@ .filter(lib => lib.libPath) | ||
// set defines from auto build | ||
opencvBuild.opencvModules.forEach(m => console.log(`HAVE_${m.toUpperCase()}`)); | ||
opencvBuild.opencvModules.forEach(m => console.log(`HAVE_${m.toUpperCase()}`)); |
@@ -1,5 +0,5 @@ | ||
const opencvBuild = require('opencv-build'); | ||
const { resolvePath, defaultDir } = require('./commons'); | ||
const opencvBuild = require(`@nut-tree/opencv-build-${process.platform}`); | ||
const { resolvePath, defaultDir, linkSystemLibs } = require('./commons'); | ||
if (opencvBuild.isAutoBuildDisabled()) { | ||
if (linkSystemLibs()) { | ||
console.log(resolvePath(process.env.OPENCV_INCLUDE_DIR) || `${defaultDir}/include`); | ||
@@ -6,0 +6,0 @@ return; |
@@ -18,3 +18,2 @@ export * from './typings/cv.d'; | ||
export * from './typings/Contour.d'; | ||
export * from './typings/Moments.d'; | ||
export * from './typings/FaceRecognizer.d'; | ||
@@ -21,0 +20,0 @@ export * from './typings/EigenFaceRecognizer.d'; |
@@ -1,3 +0,3 @@ | ||
const opencvBuild = require('opencv-build'); | ||
const { resolvePath, getLibDir } = require('./commons'); | ||
const opencvBuild = require(`@nut-tree/opencv-build-${process.platform}`); | ||
const { resolvePath, getLibDir, linkSystemLibs } = require('./commons'); | ||
@@ -11,3 +11,3 @@ function linkLibs(libs) { | ||
if (opencvBuild.isAutoBuildDisabled()) { | ||
if (linkSystemLibs()) { | ||
linkLibs(opencvBuild.getLibs(getLibDir())); | ||
@@ -25,3 +25,3 @@ return; | ||
console.log('-L' + resolvePath(opencvBuild.opencvLibDir)); | ||
opencvBuild.opencvModules.forEach(lib => console.log('-lopencv_' + lib)); | ||
opencvBuild.opencvModules.forEach(lib => console.log(`-lopencv_${lib}`)); | ||
console.log('-Wl,-rpath,' + resolvePath(opencvBuild.opencvLibDir)); |
@@ -11,3 +11,3 @@ import { Mat } from './Mat.d'; | ||
addTLD(frame: Mat, boundingBox: Rect): boolean; | ||
update(frame: Mat): Rect; | ||
update(frame: Mat): Rect[]; | ||
} |
@@ -15,3 +15,4 @@ export class TrackerKCFParams { | ||
readonly desc_npca: number; | ||
readonly detect_thresh: number; | ||
constructor(); | ||
} |
{ | ||
"name": "opencv4nodejs-prebuilt", | ||
"version": "4.14.1", | ||
"version": "4.15.0-b11", | ||
"description": "This is a fork of opencv4nodejs which provides pre-built binaries", | ||
@@ -36,3 +36,4 @@ "keywords": [ | ||
"scripts": { | ||
"install": "prebuild-install || node-gyp rebuild", | ||
"preinstall": "node ./install.js", | ||
"install": "prebuild-install --verbose || node-gyp rebuild", | ||
"configure": "node-gyp configure", | ||
@@ -50,4 +51,3 @@ "build": "node-gyp configure build", | ||
"native-node-utils": "^0.1.5", | ||
"prebuild-install": "^5.2.4", | ||
"opencv-build": "^0.0.17" | ||
"prebuild-install": "^5.3.0" | ||
}, | ||
@@ -59,3 +59,4 @@ "optionalDependencies": { | ||
"prebuild": "^8.2.0" | ||
} | ||
}, | ||
"opencv": "3.4.6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
5
2245
10512602
162
1
1
17
2
- Removedopencv-build@^0.0.17
- Removedopencv-build@0.0.17(transitive)
Updatedprebuild-install@^5.3.0