npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

opencv-web

v4.9.0-1

Published

OpenCV 4.9.0 to JavaScript + WebAssembly for web environment

Downloads

2

Readme

Compiled OpenCV following OpenCV tutorial and opencv-wasm targeting web environment.

Install

npm install opencv-web

To specify a custom path for the opencv_js.wasm file, replace PATHTOWASMFILE in the code snippet below and add it to your HTML file.

    <script>
      var Module = {
        locateFile: function(s) {
          return PATHTOWASMFILE+ s;
        }
      };
    </script> 

Compile process

./utils/build.sh

WASM=1: This flag ensures that the output is in WebAssembly format. Emscripten supports both asm.js and WebAssembly, and this flag specifies the use of WebAssembly.

NO_EXIT_RUNTIME=1: By setting this flag, the runtime does not shut down after the main function finishes executing. This is useful for applications that need to continue running after the main function completes, such as those that use async functions or handle events.

EXTRA_EXPORTED_RUNTIME_METHODS=['addOnPostRun']: This flag specifies additional runtime methods to be exported. The addOnPostRun method allows you to add functions that will be called after the main function has executed. This is useful for initializing code or handling tasks that need to occur post-execution.

ASSERTIONS=1: Enabling assertions includes runtime checks to help catch common errors and issues during development. This is useful for debugging, but these checks can be disabled in a production build to improve performance.

ALLOW_MEMORY_GROWTH=1: This flag allows the memory used by the WebAssembly module to grow dynamically. By default, WebAssembly memory is fixed in size, but enabling memory growth can help handle cases where the application needs more memory than initially allocated.

SINGLE_FILE=0: This flag controls whether to output a single file or separate files for the JavaScript and WebAssembly code. Setting it to 0 means that the output will be split into multiple files (a separate .wasm file and a .js file).

ENVIRONMENT=web: This flag specifies the target environment for the compiled code. Setting it to web indicates that the code is intended to run in a web browser environment.

EXPORT_ES6=1: This flag specifies that the output JavaScript module should use ES6 module syntax (import and export). This makes the generated code compatible with modern JavaScript module systems.

USE_ES6_IMPORT_META=0: This flag controls the use of the ES6 import.meta construct. Setting it to 0 disables the use of import.meta, which might be necessary for compatibility with certain JavaScript environments that do not support this feature.

MODULARIZE=1: This flag makes the output JavaScript code modular, meaning the WebAssembly module is wrapped in a function. This allows for better integration with JavaScript module systems and can help with namespace management.