Mapping file data to environment variables
This code is very clean and is definitely a clear improvement from your last version.

Your code is easy to understand and follow, now that's it's more broken up (aside from one big block of code).



I recommend storing your regexular expression for locating the extension .env like this:

var env = new RegExp("\.env$/", "");


The reason is for this: RegExp.test.

The test method of a RegExp object does the following:


Returns true if the regexular expression matches the input string.
Returns false if the regexular expression does not match the input string.


Now, your isEnv function does this:

return env.test(fileName);


Why is this better? Well...


The test method of RegExp only has to worry about the regexular expression matching at all.
The match method of a string has to worry about the regexular expression matching AND it has to worry about creating and returning an array of all the matches.


That being said, the test method is obviously faster than using match.