node env vars code example
Example 1: node start with environment variables
NODE_ENV=production && OTHER_ENV=foo && node ./index.js
NODE_ENV=production && OTHER_ENV=foo && npm start
$env:NODE_ENV="production"; $env:OTHER_ENV="foo"; node .\index.js
$env:NODE_ENV="production"; $env:OTHER_ENV="foo"; npm run build
set NODE_ENV=production && set OTHER_ENV=foo && node .\index.js
set NODE_ENV=production && set OTHER_ENV=foo && npm run build
Example 2: windows how to set process.env variables
set NODE_ENV=production