From b9f3988c23357628993169ce3fb88c75ad4143b4 Mon Sep 17 00:00:00 2001 From: Jorge Zapata Date: Thu, 15 May 2025 18:00:56 +0200 Subject: [PATCH] Honor Nodejs environment variables --- src/lib/libwasi.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/libwasi.js b/src/lib/libwasi.js index 109592c11b9e2..9b85b56042bba 100644 --- a/src/lib/libwasi.js +++ b/src/lib/libwasi.js @@ -67,6 +67,10 @@ var WasiLibrary = { '_': getExecutableName() #endif }; + // Forward the Node ones, if any. + if (ENVIRONMENT_IS_NODE) { + env = {...env, ...process.env}; + } // Apply the user-provided values, if any. for (var x in ENV) { // x is a key in ENV; if ENV[x] is undefined, that means it was