access dotenv file variables in package.json code example Example 1: .env require('dotenv').config() Example 2: .env npm install dotenv