What's the proper way to set env variables?

Hi everyone!
When I follow instructions in Get Set for our Back End Development Projects, all variables defined in .env file are immediately available in process.env var inside my app. However, if I write code from scratch, I have to use npm packages like dotenv to make that variables available (otherwise referring to process.env.MY_VAR yields undefined). At the same time, I don’t see that Clementine.js boilerplate uses any of that packages. What’s the secret?