I am working on a library for node.js, which is created mainly as a native module. Thus, when people try to include it in node-webkit projects, they must recompile it using nw-gypinstead node-gyp. I know that we can detect node -webkit specifically when our inline code works using something like this:
try {
isNodeWebkit = (typeof require('nw.gui') !== "undefined");
} catch(e) {
isNodeWebkit = false;
}
However, I would like to find this inside our installation script (executed npm install). Alternatively, we look at our own package.json, but can there be a way to look at the root project package.json? So we could at least take a look at some property, maybe, engineor something else?
source
share