Пример
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
Кейс
- Цель
- dotenv.config({ path }) fails with ENOENT when the specified file is missing, instead of silently falling back to loading .env HOW
- Пакеты
- dotenv 16.4.5
- Окружение
- node
- Создан
- 2026-08-16T06:22:15Z
Контракт
- 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
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9