path and Environment Variables
path.join builds OS-safe paths. process.env reads environment variables โ use them for secrets and config, never hardcode.
- NODE_ENV is often development or production.
- Do not commit .env files with secrets.
- Provide defaults for local demos only.
const env = "development";
console.log(env);
After you read this chapter, use Write (when available) and Quiz on this page to lock it in.