I'm trying to use a native addon (Node Sentinel File Watcher -a.k.a. NSFW-) in a node application and also in an electron application.
Using the same native addon with both (node and electron) doesn't work, so I have to rebuild the addon using electron-rebuild (then it will work with electron) or npm rebuild
(then it will work for node), but not for both at the same time.
I'm trying to avoid having to rebuild for switching, and I prefer to have a dynamic require depending on the platform (and I will use one specific version of electron).
Is it possible to install a dependency prebuilding it for two (or more) platforms at the same time?
I found some interesting packages like https://www.npmjs.com/package/prebuild but it looks like you need to modify the native addon (in this case NSFW).
I'm planning to use this as a private NPM package that will be distributed and used for node and for one specific version of electron.