pksunkara / electron-plugin-manager

Plugin Manager based on NPM for Electron apps
MIT License
8 stars 3 forks source link

Native Addon Modules #96

Open b3nab opened 2 years ago

b3nab commented 2 years ago

Hello :) I have some simple questions regarding the "native addon" for nodejs, in the Readme it's explicitly written that epm will not work with native addons.

pksunkara commented 2 years ago

I am not sure because I haven't tried and I didn't have a need. You can give it a go and see if it works.

b3nab commented 2 years ago

Actually I'm building an electron app and my plan is to support extensions to add external functionality and let other developers create some extensions. Since the app need to run on Windows, Mac and Linux there is a chance that a native module is needed, for example a way to mute and unmute the pc audio. Nodejs doesn't let this through its api and so I need to fallback and use a npm package that needs to be compiled because it was written in C/C++.

So I'm wondering what's the actual implementation? Basically you only use pacote.extract() to recursively unpack all dependencies and nothing else..?

pksunkara commented 2 years ago

Yup. I extract the JS files and just load them on the manager when asked.

For a native module, loading should be fine, but we would need to build it first I guess.