Skip to content

Instantly share code, notes, and snippets.

@codewithleader
Last active June 12, 2024 19:30
Show Gist options
  • Save codewithleader/f587661487223a576b48a0aa70730c47 to your computer and use it in GitHub Desktop.
Save codewithleader/f587661487223a576b48a0aa70730c47 to your computer and use it in GitHub Desktop.
NodeJS+env v20 o superior: Como configurar las variables de entorno en la version 20 de NodeJS

Configurar package.json para activar las env en la version 20 de NodeJS

  • Agregar --env-file=.env en los scripts en package.json asi:
  "scripts": {
    "dev": "tsnd --env-file=.env --respawn --clear src/app.ts",
    "start": "npm run build && node --env-file=.env dist/app.js",
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment