Ejemplo
dotenv.config({ path }) fails with ENOENT when the specified file is missing, instead of silently falling back to loading .env
sha256:81c1f10d06436657fe935460d23e4a48f80c8b300a1fa96baa4686ef600468d4
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- dotenv.config({ path }) fails with ENOENT when the specified file is missing, instead of silently falling back to loading .env HOW
- Paquetes
- dotenv 16.4.5
- Entorno
- node
- Creado
- 2026-08-16T06:22:15Z
Contrato
- create a default .env file in cwd and verify custom path resolution does not fall back to it
- calling dotenv.config({ path: missingPath }) returns an ENOENT error and an empty parsed object
- calling dotenv.config({ path: missingPath }) does not populate process.env with keys from .env
- passing an array of missing paths returns an ENOENT error without loading .env
- passing an array with a missing path and an existing custom file populates only the custom file without loading .env
- clean up all temporary test env files when finished
Archivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9