I'm currently writing a node-webkit application which uses a native module (lwip
). I found out that I need to compile native modules with nw-gyp
.
After using nw-gyp
a new file lwip_image.node
will be created under node_modules/lwip/build/Release
.
How is the native module required? Like this: var lwip_image = require('./node_modules/lwip/build/Release/lwip_image.node')
??
If the native module was created on Win8 x64, will it also work on Win7 x64 or even Win8/7 x32? Same question for Mac vs Ubuntu x32 vs Ubuntu x64?
To facilitate the build process I would build the native modules on the target platforms once. After that I would like to copy them all to my project dir so I can automate the build process to build it for all platforms at once. How would I go about that? Use os.platform()
and require depending on platform? ...
UPDATE: Those posts were what I was looking for: https://github.com/joyent/node/issues/4398#issuecomment-11233144 https://github.com/npm/npm/issues/1891