UrielCh / opencv4nodejs

ESM Nodejs bindings to OpenCV 3/4
MIT License
234 stars 49 forks source link

Support for BunJS? #153

Open ArthurTimofey opened 1 month ago

ArthurTimofey commented 1 month ago

Hey,

I'm wondering if there is a potential way to support BunJS?

As for now I am running in to the following issue with regards to Node API:

TypeError: symbol 'napi_register_module_v1' not found in native module. Is this a Node API (napi) module?

The API napi_register_module_v1 is supported in BunJS but it seems like it still does not work for me. Been trying to hack it too with no progress but any suggestions very much welcome.

For reference I have also asked bun about this issue here.

As a work around I have been building .mjs scripts and piping back the result to Bun. Which as you can imagine is super cumbersome.

UrielCh commented 1 month ago

Nope, this OpenCV4nodeJS is built on top of the previous Node native API. I tried to build a new one from scratch using the modern N-API and mapping the same binary as the official Python OpenCV API, but it took me more time than I can allocate to it.

See: https://github.com/UrielCh/opencv-sandbox

I have converted some common Python binding calls to N-API, and I think the project needs four more months to complete.

ArthurTimofey commented 1 month ago

Ah I see, well that's a shame but completely understandable.

Ill see if I can use the sandbox to try and use the functionality I need or even contribute to it.

Thanks for the great work anyways.

UrielCh commented 3 days ago

I finally change my mind and start to migrate the project to N-API so I will be able to use it with Deno and BunJS.