@ningh-o/opencv-js 4.11.0-core.0 → 4.11.0-default.1

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.

Potentially problematic release.


This version of @ningh-o/opencv-js might be problematic. Click here for more details.

package/README.md CHANGED
@@ -1,19 +1,25 @@
1
1
  # @ningh-o/opencv-js
2
2
 
3
- Self-built [OpenCV.js](https://docs.opencv.org/4.11.0/) 4.11.0 (core variant), packaged for npm by the [opencv-js build pipeline](https://github.com/ningh-o/opencv-js).
3
+ Self-built [OpenCV.js](https://docs.opencv.org/4.11.0/) 4.11.0 (default variant), packaged for npm by the [opencv-js build pipeline](https://github.com/ningh-o/opencv-js).
4
4
 
5
5
  ## Usage
6
6
 
7
7
  ```js
8
- import cv from "@ningh-o/opencv-js";
9
- // or: const cv = require("@ningh-o/opencv-js");
10
-
11
- // OpenCV.js initializes asynchronously:
12
- await new Promise((resolve) => { cv.onRuntimeInitialized = resolve; });
8
+ import cvModule from "@ningh-o/opencv-js";
9
+ // The package exports a Promise that resolves to the initialized module:
10
+ const cv = await cvModule;
13
11
  console.log(cv.getBuildInformation());
14
12
  ```
15
13
 
14
+ CommonJS: `require("@ningh-o/opencv-js")` returns the same Promise:
15
+
16
+ ```js
17
+ const cvModule = require("@ningh-o/opencv-js");
18
+ cvModule.then((cv) => console.log(cv.getBuildInformation()));
19
+ ```
20
+
16
21
  - OpenCV version: **4.11.0**
17
- - Variant: **core**
22
+ - Variant: **default**
18
23
  - Built with Emscripten from the official OpenCV sources (WebAssembly + SIMD).
24
+ - TypeScript declarations included (`index.d.ts`).
19
25
  - License: Apache-2.0 (see LICENSE).