{"action":"created","issue":{"url":"https://api.github.com/repos/lorenwest/node-config/issues/440","repository_url":"https://api.github.com/repos/lorenwest/node-config","labels_url":"https://api.github.com/repos/lorenwest/node-config/issues/440/labels{/name}","comments_url":"https://api.github.com/repos/lorenwest/node-config/issues/440/comments","events_url":"https://api.github.com/repos/lorenwest/node-config/issues/440/events","html_url":"https://github.com/lorenwest/node-config/issues/440","id":266177231,"number":440,"title":"Can NODE_ENV be changed via nodejs code?","user":{"login":"fractalocity","id":29801289,"avatar_url":"https://avatars1.githubusercontent.com/u/29801289?v=4","gravatar_id":"","url":"https://api.github.com/users/fractalocity","html_url":"https://github.com/fractalocity","followers_url":"https://api.github.com/users/fractalocity/followers","following_url":"https://api.github.com/users/fractalocity/following{/other_user}","gists_url":"https://api.github.com/users/fractalocity/gists{/gist_id}","starred_url":"https://api.github.com/users/fractalocity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fractalocity/subscriptions","organizations_url":"https://api.github.com/users/fractalocity/orgs","repos_url":"https://api.github.com/users/fractalocity/repos","events_url":"https://api.github.com/users/fractalocity/events{/privacy}","received_events_url":"https://api.github.com/users/fractalocity/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-17T15:42:01Z","updated_at":"2017-10-17T17:20:38Z","closed_at":"2017-10-17T17:20:38Z","author_association":"NONE","body":"by reading the following page,  [NODE_ENV](https://dzone.com/articles/what-you-should-know-about-node-env) , I get the understanding that NODE_ENV can be changed within your node.js code (ie: while the code is running).\r\n\r\nHowever, when i change process.env.NODE_ENV within the code and then check config's NODE_ENV, I see that it did not change.\r\nprocess.env.NODE_ENV = 'Testing';\r\nconsole.log('NODE_ENV: ' + config.util.getEnv('NODE_ENV')); // is still development, did Not change to Testing\r\n\r\n**Question**: how do you change the config.util.getEnv('NODE_ENV')) variable? Can I change the file which node-config is looking at in the middle of code execution? This is probably not advised for various reasons. However, was still wondering if this was possible.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/lorenwest/node-config/issues/comments/337303698","html_url":"https://github.com/lorenwest/node-config/issues/440#issuecomment-337303698","issue_url":"https://api.github.com/repos/lorenwest/node-config/issues/440","id":337303698,"user":{"login":"markstos","id":25829,"avatar_url":"https://avatars1.githubusercontent.com/u/25829?v=4","gravatar_id":"","url":"https://api.github.com/users/markstos","html_url":"https://github.com/markstos","followers_url":"https://api.github.com/users/markstos/followers","following_url":"https://api.github.com/users/markstos/following{/other_user}","gists_url":"https://api.github.com/users/markstos/gists{/gist_id}","starred_url":"https://api.github.com/users/markstos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstos/subscriptions","organizations_url":"https://api.github.com/users/markstos/orgs","repos_url":"https://api.github.com/users/markstos/repos","events_url":"https://api.github.com/users/markstos/events{/privacy}","received_events_url":"https://api.github.com/users/markstos/received_events","type":"User","site_admin":false},"created_at":"2017-10-17T17:20:38Z","updated_at":"2017-10-17T17:20:38Z","author_association":"COLLABORATOR","body":"For support questions, please use StackOverflow and tag your question with node-config. \r\n\r\nhttps://stackoverflow.com/questions/tagged/node-config"}}
{"actor":{"display_login":"markstos"}}