env.NODE With this code we will only load the .env file if t 11-digit phone number format philippines he server is not already in production mode. Let's see this in action. Install dotenvin a directory as shown above. Then create a dotenv-example. and insert the following lines in it: JavaScript Copy the code console.

log('No value for FOO yet:', process.env.FOO); if (process.env.NODE_ENV !== 'production') { require('dotenv').config(); } console.log('Now the value for FOO is:', process.env.FOO); Next, create a file named .envin the same directory, with the following contents: JavaScript Copy the code FOO=bar Run the script: JavaScript Copy the code node dotenv-example.js The output should look like: JavaScript Copy the code No value for FOO yet: undefined Now the value for FOO is: bar As you can see, the value was loaded and set using dotenv.