How to read environment variables of a specific user in windows with nodejs? Tried using process.env but it seems to return only system variables.
1 Answer
There is no such distinction of user's vs. system environment variables. You can access all of the environment variables that are set for your process by accessing process.env. If something is missing there then it means that there is no such environment variable set. If you need more environment variables being set then either set them before starting your Node program or change the user's config so that they are set automatically.
1 Comment
nimble_ninja
In the Windows operating system, if you go to System Properties, and click the "Environment variables..." button, then it displays both "User variables for <username>" and "System variables." How do you run a Node process so that the environment variables set for that process include both of the above?