ibm-messaging / mq-mqi-nodejs

Calling IBM MQ from Node.js - a JavaScript MQI wrapper
Apache License 2.0
79 stars 42 forks source link

Support for .npmrc is missing #176

Closed tperamaki closed 5 months ago

tperamaki commented 9 months ago

We are in an environment where we cannot reach the ibm url to download the redist, so we need to set the MQIJS_LOCAL_URL to something that is reachable.

Now since this is needed already on the npm install command, every developer needs to prefix their command with that env variable to get it working. Also same applies to CI pipeline.

Now this could be avoided by adding the env variable to .npmrc, which is meant for this exact purpose, and the file could be included in the repository and it would work for each developer and CI pipeline without any extra hassle.

The issue here is that adding env variable to .npmrc changes the name of the env variable, and this library does not support that.

For example adding env variable with name MY_ENV to .npmrc results in process.env.npm_config_my_env, so adding support for env variable named as such in addition to the current one, would allow people to use the .npmrc to set the url for whole project and not require every developer to add it to their commands manually.

ibmmqmet commented 9 months ago

Thanks for the suggestion. I'll take a look at it for the next release.

ibmmqmet commented 8 months ago

Done in latest release