title: How can I use environment variable as compile-time constant in native nodejs addon?
body: <p>I am writing a native addon for NodeJS. How can I use an environment variable as a constant at compile time? That is, "inject" a constant in to the NodeJS C++ addon from an environment variable set during <code>node-gyp build</code> or <code>npm install</code>. I found <a href="https://stackoverflow.com/questions/22826665/use-environment-variable-as-compile-time-constant-in-c">this answer</a>, however as far as I can see, there is no equivalent option for passing through variables to node-gyp</p>