@ningh-o/opencv-js 4.12.0-core.0 → 4.12.0-rev.2

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
@@ -1,19 +1,24 @@
1
1
  # @ningh-o/opencv-js
2
2
 
3
- Self-built [OpenCV.js](https://docs.opencv.org/4.12.0/) 4.12.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.12.0/) 4.12.0, 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.12.0**
17
- - Variant: **core**
18
22
  - Built with Emscripten from the official OpenCV sources (WebAssembly + SIMD).
23
+ - TypeScript declarations included (`index.d.ts`).
19
24
  - License: Apache-2.0 (see LICENSE).