Socket
Socket
Sign inDemoInstall

opencv4nodejs-prebuilt

Package Overview
Dependencies
72
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.14.1 to 4.15.0-b11

install.js

23

lib/commons.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc