@techstark/opencv-js 4.8.0-release.1 → 4.8.0-release.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,8 +30,17 @@ TypeScript is supported (thanks to `mirada`).
30
30
 
31
31
  - `npm install @techstark/opencv-js`
32
32
  - or `yarn add @techstark/opencv-js`
33
- - `import cv from "@techstark/opencv-js"`
34
- - or `import * as cv from "@techstark/opencv-js"` for Angular
33
+ - `const cv = await import("@techstark/opencv-js");`
34
+ - or wrap it in an async function like
35
+
36
+ ```js
37
+ async function getOpenCv() {
38
+ const cv = await import("@techstark/opencv-js");
39
+ // for development
40
+ window.cv = cv;
41
+ return cv;
42
+ }
43
+ ```
35
44
 
36
45
  # Webpack Configuration (for browser usage)
37
46
 
package/dist/README.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## Build opencv.js
2
+
3
+ - see https://github.com/opencv/opencv/blob/4.x/platforms/js/README.md
4
+ - also https://docs.opencv.org/4.7.0/d4/da1/tutorial_js_setup.html
5
+
6
+ ```sh
7
+ cd ~/apps/emsdk
8
+ ./emsdk update
9
+ ./emsdk install 2.0.10
10
+ ./emsdk activate 2.0.10
11
+ ```
12
+
13
+ - build
14
+
15
+ ```sh
16
+ source ~/apps/emsdk/emsdk_env.sh
17
+ emcmake python ./platforms/js/build_js.py build_js --build_wasm
18
+ ```
19
+
1
20
  ## Patch opencv.js
2
21
 
3
22
  - To create a patch for the current version of opencv.js, run:
@@ -9,6 +28,6 @@ mv temp.patch dist/opencv.js.patch
9
28
 
10
29
  - To apply the patch, run:
11
30
 
12
- ```
31
+ ```sh
13
32
  git apply dist/opencv.js.patch
14
33
  ```