Fork me on GitHub
#off-topic
<
2022-10-08
>
mauricio.szabo05:10:23

Folks, does somebody knows how to work with native node.js modules with N-API? I'm having quite a hard time trying to construct a C++ object (wrapped via ObjectWrap) from outside the class...

borkdude09:10:39

@U3Y18N0UC Don't know about that one. Are you using node.js because of Atom or arbitrary reasons? You could also try bun.sh which has an improved built-in FFI library

mauricio.szabo18:10:15

Because of Atom, unfortunately... there are a lot of in-house extensions that are written in C++ with the outdated Nan library. I found the easiest way to make then work is to convert to N-API. Both are horribly documented but at least N-API is "Call this method, return this value" instead of Nan that is "Copy this memory address to this other one" facepalm

Daniel Tan02:10:12

this may help

Daniel Tan02:10:09

we had the same pain when bridging ai/ml libs for nodejs

mauricio.szabo15:10:58

The problem for me is that everything I'm seeing is too basic. For example, how do I instantiate a Javascript Set from N-API? I can't seem to find any doc; How do I call a JS function on N-API? Again, almost no results How do I make console.log work? Nothing

Jeongsoo Lee15:10:18

Covid has struck my family and it’s been a week. Stay safe, everyone..

❤️ 11
mauricio.szabo18:10:15

Re-clojure is asking me for a speaker tagline. Does "Your organic pal that's fun to be with!" is good enough? 😄

lambda-prompt 1
p-himik18:10:37

FWIW, personally I prefer "dumb" straight-to-business headlines. They make it so much easier to decide whether a recorded video is for me or not.

mauricio.szabo18:10:26

Yeah, I went for a straight-to-business too.

🙏 1