{"_id":"@edumolki/opencv-build","_rev":"2-f55b43c9a854f806324e63817a667f1e","name":"@edumolki/opencv-build","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@edumolki/opencv-build","version":"1.0.0","description":"A simple script to auto build recent OpenCV + contrib version via npm 2022 Edition","main":"dist/cjs/index.js","module":"./dist/esm/index.js","typings":"dist/cjs/index.d.ts","exports":{".":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.js","types":"./dist/cjs/index.d.ts"}},"publishConfig":{"access":"public"},"scripts":{"clean":"rimraf build","build":"tsc --pretty --project . && tsc --pretty --project tsconfig-cjs.json","build3x":"npm run build && node bin/main.js --keepsource","install_macm1":"npm run build && node bin/main.js --version 4.5.5 --flag=\"-DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64\"","install_4_6_0":"npm run build && node bin/main.js --version 4.6.0","install_4_6_0_cuda_30XX":"npm run build && cross-env OPENCV4NODEJS_DISABLE_AUTOBUILD= node bin/main.js --keepsource --version 4.6.0 --cuda --cudaArch=8.6","install_4_7_0_cuda_30XX":"npm run build && cross-env OPENCV4NODEJS_DISABLE_AUTOBUILD= node bin/main.js --keepsource --version 4.7.0 --cuda --cudaArch=8.6","do-install":"node bin/main.js","cleanbuild":"rimraf lib dist && npm run build","postinstallDISABLED":"npm run do-install","prepare":"npm run build","prepublishOnly":"npm run build","lint":"eslint src/**/*.ts","test":"cross-env NODE_OPTIONS=\"-r ts-node/register --no-warnings\" TS_NODE_PROJECT=tsconfig-cjs.json mocha 'test/**/*.test.ts'"},"bin":{"opencv-build-npm":"bin/main.js"},"repository":{"type":"git","url":"git+https://github.com/eduardoabpereira/npm-opencv-build.git"},"keywords":["opencv","build","opencv4nodejs"],"license":"MIT","bugs":{"url":"https://github.com/eduardoabpereira/npm-opencv-build/issues"},"homepage":"https://github.com/eduardoabpereira/npm-opencv-build#readme","dependencies":{"@u4/tiny-glob":"^0.3.2","npmlog":"^7.0.1","picocolors":"^1.0.0","rimraf":"^4.4.1"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-string":"^1.4.2","@types/mocha":"^10.0.1","@types/node":"^18.15.11","@types/npmlog":"^4.1.4","@typescript-eslint/eslint-plugin":"^5.57.0","@typescript-eslint/parser":"^5.57.0","chai":"^4.3.7","chai-string":"^1.5.0","cross-env":"^7.0.3","eslint":"^8.37.0","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.0.2"},"_id":"@edumolki/opencv-build@1.0.0","gitHead":"5b3078cfb9b02d5cc78379e8841947170051399e","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-WFsew36eapjbz78xz2jylUg7qBGhmVKv47RynUEGy5x5Tnb7uODhaMS341LbaV5CmrdKGe6+PQkMiEUsaHCmmQ==","shasum":"f24257b10b12852fed99846242c7614c7a576e12","tarball":"https://registry.npmjs.org/@edumolki/opencv-build/-/opencv-build-1.0.0.tgz","fileCount":63,"unpackedSize":359414,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAyDTpILZ5ewMeUgY1mNK1Dri3+LsHKu74KCHao93dtyAiEA7pRSDfLUGtIosverTRjMD/02welMv1qT//yx/b715kE="}]},"_npmUser":{"name":"edumolki","email":"edu.eabp@gmail.com"},"directories":{},"maintainers":[{"name":"edumolki","email":"edu.eabp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/opencv-build_1.0.0_1709504183005_0.045992533668717694"},"_hasShrinkwrap":false},"1.0.1":{"name":"@edumolki/opencv-build","version":"1.0.1","description":"A simple script to auto build recent OpenCV + contrib version via npm 2022 Edition","main":"dist/cjs/index.js","module":"./dist/esm/index.js","typings":"dist/cjs/index.d.ts","exports":{".":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.js","types":"./dist/cjs/index.d.ts"}},"publishConfig":{"access":"public"},"scripts":{"clean":"rimraf build","build":"tsc --pretty --project . && tsc --pretty --project tsconfig-cjs.json","build3x":"npm run build && node bin/main.js --keepsource","install_macm1":"npm run build && node bin/main.js --version 4.5.5 --flag=\"-DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64\"","install_4_6_0":"npm run build && node bin/main.js --version 4.6.0","install_4_6_0_cuda_30XX":"npm run build && cross-env OPENCV4NODEJS_DISABLE_AUTOBUILD= node bin/main.js --keepsource --version 4.6.0 --cuda --cudaArch=8.6","install_4_7_0_cuda_30XX":"npm run build && cross-env OPENCV4NODEJS_DISABLE_AUTOBUILD= node bin/main.js --keepsource --version 4.7.0 --cuda --cudaArch=8.6","do-install":"node bin/main.js","cleanbuild":"rimraf lib dist && npm run build","postinstallDISABLED":"npm run do-install","prepare":"npm run build","prepublishOnly":"npm run build","lint":"eslint src/**/*.ts","test":"cross-env NODE_OPTIONS=\"-r ts-node/register --no-warnings\" TS_NODE_PROJECT=tsconfig-cjs.json mocha 'test/**/*.test.ts'"},"bin":{"opencv-build-npm":"bin/main.js"},"repository":{"type":"git","url":"git+https://github.com/eduardoabpereira/npm-opencv-build.git"},"keywords":["opencv","build","opencv4nodejs"],"license":"MIT","bugs":{"url":"https://github.com/eduardoabpereira/npm-opencv-build/issues"},"homepage":"https://github.com/eduardoabpereira/npm-opencv-build#readme","dependencies":{"@u4/tiny-glob":"^0.3.2","npmlog":"^7.0.1","picocolors":"^1.0.0","rimraf":"^4.4.1"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-string":"^1.4.2","@types/mocha":"^10.0.1","@types/node":"^18.15.11","@types/npmlog":"^4.1.4","@typescript-eslint/eslint-plugin":"^5.57.0","@typescript-eslint/parser":"^5.57.0","chai":"^4.3.7","chai-string":"^1.5.0","cross-env":"^7.0.3","eslint":"^8.37.0","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.0.2"},"_id":"@edumolki/opencv-build@1.0.1","gitHead":"5b3078cfb9b02d5cc78379e8841947170051399e","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-n+rdtJnWzteb7G/kvwGQQm0xpjO1Wjz8CVaecCb/MZ+SXB2DtrufRXiYQ3HunBIK7EBbhT4dsCrVBKpepbPUDg==","shasum":"0fbf386b8b7999627ee6bdc9bffd611b86f9ceae","tarball":"https://registry.npmjs.org/@edumolki/opencv-build/-/opencv-build-1.0.1.tgz","fileCount":63,"unpackedSize":359413,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjDMlEy1KfJCHeyk4HHeE04/r4ZI/3wmuoOGQsbbExcgIgUwKncya2SUFfVwqBT1MVk0E+aLmJVrg6i5wZl9XV2g8="}]},"_npmUser":{"name":"edumolki","email":"edu.eabp@gmail.com"},"directories":{},"maintainers":[{"name":"edumolki","email":"edu.eabp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/opencv-build_1.0.1_1709512636058_0.3348088280634074"},"_hasShrinkwrap":false},"1.0.2":{"name":"@edumolki/opencv-build","version":"1.0.2","description":"A simple script to auto build recent OpenCV + contrib version via npm 2022 Edition","main":"dist/cjs/index.js","module":"./dist/esm/index.js","typings":"dist/cjs/index.d.ts","exports":{".":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.js","types":"./dist/cjs/index.d.ts"}},"publishConfig":{"access":"public"},"scripts":{"clean":"rimraf build","build":"tsc --pretty --project . && tsc --pretty --project tsconfig-cjs.json","build3x":"npm run build && node bin/main.js --keepsource","install_macm1":"npm run build && node bin/main.js --version 4.5.5 --flag=\"-DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64\"","install_4_6_0":"npm run build && node bin/main.js --version 4.6.0","install_4_6_0_cuda_30XX":"npm run build && cross-env OPENCV4NODEJS_DISABLE_AUTOBUILD= node bin/main.js --keepsource --version 4.6.0 --cuda --cudaArch=8.6","install_4_7_0_cuda_30XX":"npm run build && cross-env OPENCV4NODEJS_DISABLE_AUTOBUILD= node bin/main.js --keepsource --version 4.7.0 --cuda --cudaArch=8.6","do-install":"node bin/main.js","cleanbuild":"rimraf lib dist && npm run build","postinstallDISABLED":"npm run do-install","prepare":"npm run build","prepublishOnly":"npm run build","lint":"eslint src/**/*.ts","test":"cross-env NODE_OPTIONS=\"-r ts-node/register --no-warnings\" TS_NODE_PROJECT=tsconfig-cjs.json mocha 'test/**/*.test.ts'"},"bin":{"opencv-build-npm":"bin/main.js"},"repository":{"type":"git","url":"git+https://github.com/eduardoabpereira/npm-opencv-build.git"},"keywords":["opencv","build","opencv4nodejs"],"license":"MIT","bugs":{"url":"https://github.com/eduardoabpereira/npm-opencv-build/issues"},"homepage":"https://github.com/eduardoabpereira/npm-opencv-build#readme","dependencies":{"@u4/tiny-glob":"^0.3.2","npmlog":"^7.0.1","picocolors":"^1.0.0","rimraf":"^4.4.1"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-string":"^1.4.2","@types/mocha":"^10.0.1","@types/node":"^18.15.11","@types/npmlog":"^4.1.4","@typescript-eslint/eslint-plugin":"^5.57.0","@typescript-eslint/parser":"^5.57.0","chai":"^4.3.7","chai-string":"^1.5.0","cross-env":"^7.0.3","eslint":"^8.37.0","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.0.2"},"_id":"@edumolki/opencv-build@1.0.2","gitHead":"5b3078cfb9b02d5cc78379e8841947170051399e","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-B5fMLBCgMZW/FMeIAi2Gcitqh/iRwr3Kh5YUMsWZsM5Llzv8S7NrPlUub7GgQtf86sRRB7flMk6Im2TC+ONcdw==","shasum":"0f9aa5e0e8dbc64e3c21c3475119031ee9dfb916","tarball":"https://registry.npmjs.org/@edumolki/opencv-build/-/opencv-build-1.0.2.tgz","fileCount":63,"unpackedSize":359413,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8FIvUDJgjUC98vyy0d5zaYDsNBrheKIAwOqw2iHKt8AiEAgz6hlg3W5pzCocxJ51E5FYm8O5BWWud41UReLbF/QUA="}]},"_npmUser":{"name":"edumolki","email":"edu.eabp@gmail.com"},"directories":{},"maintainers":[{"name":"edumolki","email":"edu.eabp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/opencv-build_1.0.2_1709595444764_0.3589416822414857"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-03T22:16:22.893Z","1.0.0":"2024-03-03T22:16:23.182Z","modified":"2024-03-04T23:37:25.460Z","1.0.1":"2024-03-04T00:37:16.236Z","1.0.2":"2024-03-04T23:37:25.025Z"},"maintainers":[{"name":"edumolki","email":"edu.eabp@gmail.com"}],"description":"A simple script to auto build recent OpenCV + contrib version via npm 2022 Edition","homepage":"https://github.com/eduardoabpereira/npm-opencv-build#readme","keywords":["opencv","build","opencv4nodejs"],"repository":{"type":"git","url":"git+https://github.com/eduardoabpereira/npm-opencv-build.git"},"bugs":{"url":"https://github.com/eduardoabpereira/npm-opencv-build/issues"},"license":"MIT","readme":"# @u4/opencv-build\r\n\r\n[![NPM Version](https://img.shields.io/npm/v/@u4/opencv-build.svg?style=flat)](https://www.npmjs.org/package/@u4/opencv-build)\r\n[![Build status](https://ci.appveyor.com/api/projects/status/uv8n2sruno95rxtq/branch/master?svg=true)](https://ci.appveyor.com/project/justadudewhohacks/npm-opencv-build/branch/master)\r\n\r\nA simple script to auto build recent OpenCV + contrib version via npm. This script is used to auto build [*opencv4nodejs*](https://github.com/UrielCh/opencv4nodejs).\r\n\r\n## Main changes from the original project\r\n\r\n- OpenCV is explicitly build with `opencv-build-npm` and accepting parametes see `opencv-build-npm --help`\r\n- OpenCV build can now be configured with `new OpenCVBuilder({autoBuildOpencvVersion: \"3.4.16\", autoBuildBuildCuda: true, autoBuildWithoutContrib: false }).install()`\r\n- Each OPENCV_VERSION will be build in his own directory.\r\n- Each AUTOBUILD_FLAGS will be build in his own directory. (induce massive time gain during development)\r\n- All build can now be build outside node_modules using `OPENCV_BUILD_ROOT` environement variable.\r\n- New MSBuild.exe localisation, also works with VS 2019\r\n- Script output is now colorized.\r\n- Add some usefull log.\r\n- Big code refactor.\r\n- Enfoce typing.\r\n- Add comments and documentations.\r\n\r\nEach OpenCV build will take around 2Gb on your drive, so I recommand you to define the `OPENCV_BUILD_ROOT` environement variable to avoid duplicate buildsand avoid node_modules auto flushs.\r\n\r\n## Install\r\n\r\n``` bash\r\nnpm install opencv-build\r\n```\r\n\r\n## usage\r\n\r\n```bash\r\nnpm-opencv-build usage:\r\n   --version <value>    OpenCV version                           (OPENCV4NODEJS_AUTOBUILD_OPENCV_VERSION env variable)\r\n   --flags <value>      OpenCV cMake Build flags                 (OPENCV4NODEJS_AUTOBUILD_FLAGS env variable)\r\n   --root <value>       OpenCV-build root directory (deprecated) (INIT_CWD env variable)\r\n   --buildRoot <value>  OpenCV build directory                   (OPENCV_BUILD_ROOT env variable)\r\n   --cuda               Enable cuda in OpenCV build              (OPENCV4NODEJS_BUILD_CUDA env variable)\r\n   --cudaArch <value>   Specify the cuda arch will drasticly reduce build time, see https://en.wikipedia.org/wiki/CUDA,\r\n                        ex if you have a RTX 3080 use --cudaArch=8.6, if you have also a RTX 2080 --cudaArch=7.5,8.6\r\n                                                                 (OPENCV4NODEJS_BUILD_CUDA_ARCH env variable)\r\n   --nocontrib          Do not compile Contrib modules           (OPENCV4NODEJS_AUTOBUILD_WITHOUT_CONTRIB env variable)\r\n   --nobuild            Do build OpenCV                          (OPENCV4NODEJS_DISABLE_AUTOBUILD env variable)\r\n   --incDir <value>     OpenCV include directory                 (OPENCV_INCLUDE_DIR env variable)\r\n   --libDir <value>     OpenCV library directory                 (OPENCV_LIB_DIR env variable)\r\n   --binDir <value>     OpenCV bin directory                     (OPENCV_BIN_DIR env variable)\r\n   --keepsources        Keepsources OpenCV source after build\r\n   --dry-run            Display command line use to build library\r\n   --git-cache          Reduce Bandwide usage, by keeping a local git souce un the buildRoot (OPENCV_GIT_CACHE env variable)\r\n```\r\n\r\n## Requirements\r\n\r\n- cmake\r\n\r\n### Windows\r\n\r\nfor nodejs <= 12\r\n\r\n``` bash\r\nnpm install --global windows-build-tools\r\n```\r\n\r\n## OpenCVBuildEnv options\r\n\r\nIt's possible to specify build environment variables by passing argument to the builder script\r\n\r\n```bash\r\nnode lib/main.js --version 4.5.5 --buildRoot ~/openCV\r\n```\r\n\r\nwith flags, do not forget the quotes `\"`\r\n\r\n```bash\r\nnode lib/main.js --version 4.5.5 --buildRoot ~/openCV --flags \"-DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_PC_FILE_NAME=opencv.pc\"\r\n```\r\n\r\nUsing the bin alias\r\n\r\n```bash\r\nopencv-build-npm --version 4.5.5\r\n```\r\n\r\nOr by inserting them into the `package.json` where the dependency is declared an object like:\r\n\r\n```json\r\n{\r\n  \"opencv4nodejs\": {\r\n    \"autoBuildFlags\": \"-DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_PC_FILE_NAME=opencv.pc\",\r\n    \"autoBuildOpencvVersion\": \"4.6.0\"\r\n  }\r\n}\r\n```\r\n\r\nBy using environement varaibles.\r\n\r\n```bash\r\nexport OPENCV4NODEJS_AUTOBUILD_FLAGS=\"-DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_PC_FILE_NAME=opencv.pc\"\r\nexport OPENCV4NODEJS_AUTOBUILD_OPENCV_VERSION=\"4.6.0\"\r\nexport OPENCV_BUILD_ROOT=\"~/openCV\"\r\n\r\nnode build/main.js\r\n```\r\n\r\n### prebuild\r\n\r\nThe `prebuild` is a smart version selector, to avoid futher re-compilation, accepted values are:\r\n\r\n- `\"latestBuild\"` use the last built version\r\n- `\"latestVersion\"` use the highest version number built\r\n- `\"oldestBuild\"` use the olderst built version\r\n- `\"oldestVersion\"` use the lowest version number built\r\n\r\nthe `prebuild` option intend to be use at runtime, so you do not have to keep trak of the version you want to use.\r\n\r\n- this parameter can only be provide in `OpenCVBuildEnv` constructor options.\r\n- `prebuild` is ignored if OPENCV4NODEJS_DISABLE_AUTOBUILD env variable is set, or disableAutoBuild is set in package.json\r\n\r\n### autoBuildOpencvVersion\r\n\r\nChoose the openCV version you want to build, default is 4.5.5,\r\n\r\nThis option value can be provide using:\r\n\r\n- The `--version` in build script\r\n- The `autoBuildOpencvVersion` options field provided to `OpenCVBuildEnv` constructor options.\r\n- The `autoBuildOpencvVersion` field in the current package.json `opencv4nodejs` object.\r\n- The `OPENCV4NODEJS_AUTOBUILD_OPENCV_VERSION` environement variable.\r\n\r\n### buildRoot\r\n\r\nThe `buildRoot` is the most important parameter, it define the directory used to build openCV, Default value is the npm-opencv-build directory.\r\nYou generaly want to use this value to persist your build files out of your `node_modules` directory, and buy doing som share openCV built between your project.\r\n\r\nThis option value can be provide using:\r\n\r\n- The `--buildRoot` in build script\r\n- The `buildRoot` options field provided to `OpenCVBuildEnv` constructor options.\r\n- The `OPENCV_BUILD_ROOT` environement variable.\r\n\r\n### git-cache\r\n\r\nThe `git-cache` reduce git clone data transfert, git data will be cache in you `buildRoot`, so you will onlyt downdload all git file once.\r\n\r\nThis option value can be provide using:\r\n\r\n- The `--git-cache` in build script\r\n- The `git-cache` options field provided to `OpenCVBuildEnv` constructor options.\r\n- The `OPENCV_GIT_CACHE` environement variable.\r\n\r\n### autoBuildBuildCuda\r\n\r\nSet any value to enable, the following cMake flag will be added:\r\n\r\n- DWITH_CUDA=ON\r\n- DBUILD_opencv_cudacodec=OFF // video codec (NVCUVID) is deprecated in cuda 10, so don't add it\r\n- DCUDA_FAST_MATH=ON // optional\r\n- DWITH_CUBLAS=ON // optional\r\n\r\nThis option value can be enable using:\r\n\r\n- The `--cuda` in build script\r\n- The `autoBuildBuildCuda` options field provided to `OpenCVBuildEnv` constructor options.\r\n- The `autoBuildBuildCuda` field in the current package.json `opencv4nodejs` object.\r\n- The `OPENCV4NODEJS_BUILD_CUDA` environement variable.\r\n\r\n### autoBuildFlags\r\n\r\nAppend option to CMake flags.\r\n\r\nThis option value can be enable using:\r\n\r\n- The `--flags` in build script\r\n- The `autoBuildFlags` options field provided to `OpenCVBuildEnv` constructor options.\r\n- The `autoBuildFlags` field in the current package.json `opencv4nodejs` object.\r\n- The `OPENCV4NODEJS_AUTOBUILD_FLAGS` environement variable.\r\n\r\n### autoBuildWithoutContrib\r\n\r\nSet any value to enable, this option will skip openCV Contribs.\r\n\r\nThis option value can be enable using:\r\n\r\n- The `--nocontrib` in build script\r\n- The `autoBuildWithoutContrib` options field provided to `OpenCVBuildEnv` constructor options.\r\n- The `autoBuildWithoutContrib` field in the current package.json `opencv4nodejs` object.\r\n- The `OPENCV4NODEJS_AUTOBUILD_WITHOUT_CONTRIB` environement variable.\r\n\r\n### disableAutoBuild\r\n\r\nSet any value to disable compilation from sources.\r\n\r\nThis option value can be enable using:\r\n\r\n- The `--nobuild` in build script\r\n- The `disableAutoBuild` options field provided to `OpenCVBuildEnv` constructor options.\r\n- The `disableAutoBuild` field in the current package.json `opencv4nodejs` object.\r\n- The `OPENCV4NODEJS_DISABLE_AUTOBUILD` environement variable.\r\n\r\nGeneraly you should prefer using the environment variables *OPENCV4NODEJS_DISABLE_AUTOBUILD*\r\n\r\n### opencvIncludeDir\r\n\r\nOver write the *OPENCV_INCLUDE_DIR* environment variables\r\n\r\n### opencvLibDir\r\n\r\nOver write the *OPENCV_LIB_DIR* environment variables\r\n\r\n### opencvBinDir\r\n\r\nOver write the *OPENCV_BIN_DIR* environment variables\r\n\r\n## build test\r\n\r\n```bash\r\nopencv-build-npm --flags=\"-DBUILD_LIST=core,imgproc,imgcodecs,videoio,highgui,video,calib3d,features2d,objdetect,dnn,ml,flann,photo,stitching,gapi\" --version=3.4.15 --nocontrib\r\n```\r\n\r\n```bash\r\nopencv-build-npm --version=4.5.5 --nocontrib\r\n```\r\n","readmeFilename":"README.md"}