Open pfiaux opened 7 years ago
I was able to solve this by using https://github.com/charto/autogypi with the autogypi.json
file and adding something like "install": "mkdir -p ./build && cp -R node_modules/my-lib/build/* ./build",
to my package.json.
Actually it would be nice to avoid this work around, it feels like a hack to need that.
Would it be possible for findCompiledModule
to resolve the path based on a require.resolve()
of libModule rather than appModule?
After doing some digging I think I found a solution, init
, find
and findCompiledModule
take a basepath parameter which defaults to pwd at some point.
So from my libModule
if I call nbind.init(__dirname)
(in my case __dirname matches the modules path).
It wasn't until I looked at the source that I noticed it, I couldn't find documentation about it. I think it makes sense to document the possible parameters for init()
in the README.md it would make it much easier to find.
I'm using nbind to access a c library, I have a working set of bindings in a libModule and I want to use the interface I export in a separate module appModule.
The setup looks like this:
I use it in the following way:
npm link ../libModule
.libModule = require('libModule')
Is there a way to tell nbind to look for the bindings in
libModule/build
instead of inappModule/build
? For now I can create a symlink to thebuild/
fromappModule/
tolibModule/
but it doesn't feel like a clean solution.My expectation is that if
require('nbind')
is inlibModule/index.js
it looks for thebuild/...
files inlibModule
and notappModule
.