diff --git a/src/index.ts b/src/index.ts index 3fda384..a998b4f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,11 +30,7 @@ async function loadEnv(envpath?: string) { const env = process.env const envPath = envpath; if (envPath != undefined && existsSync(envPath)) { - const content = await fs.readFile(envPath, 'utf-8'); - content.split('\n').forEach(line => { - const [key, value] = line.split('='); - if (key && value) process.env[key.trim()] = value.trim(); - }); + process.loadEnvFile(envpath) console.log('[i] Archivo .env cargado desde ' + envpath); console.log("ENV:", env) } else {