Expose absolute path of nodewebkit via node api
FWeinb opened this issue · 9 comments
It would be great if this project could provide an API to access the path to the downloaded/installed node-webkit
. Currently I am working on node-webkit-screenshot
and require the findpath.js
explicitly but that feels kinda hacky.
See this line: https://github.com/FWeinb/node-webkit-screenshot/blob/master/index.js#L5
I can provide a PR if you want.
Sure that would be great. Could you add an ./index.js
that exposes module.exports.findpath = require('./lib/findpath.js')
?
This is exactly what i had in mind. But how would you publish it on npm? You are bound to the node-webkit
releases?
I append -1
, -2
, -3
, etc to the version for fixes to the installer. It's not great and will be extra weird for 0.10.0-rc1-1
but I don't know any better solution.
Okay.
Installing 0.10.0-rc1-1
will result in print undefined
in the post install script:
> nodewebkit@0.10.0-rc1-1 postinstall /Users/FWeinb/GitHub/node-webkit-screenshot/node_modules/nodewebkit
> node scripts/install.js
undefined
It's because you appended -1
to the version and don't care about that in the install.js
:
See: https://github.com/shama/nodewebkit/blob/master/scripts/install.js#L12-L14
Whoops, sorry about that. Give 0.10.0-rc1-2
a try. Thanks!
Sorry, but still no luck. You forgot to add the index.js
to the
files
array in the package.json
. So it will not get installed via npm install
Sorry! I assumed npm would automatically include it as it's the main. Published 0.10.0-rc1-3
with the fix.