Answer the question
In order to leave comments, you need to log in
How to connect process.env to a node application so that variables can be set through the console?
I read about process.env
, but I didn’t quite understand how it works
. I have an installed application with npm and I run it through the console npx playwright test
. Can I somehow specify the value for the variables in the console in this launch?
It seems that I stumbled upon process.env
, but I could not quite understand if it can be used anywhere and how to do it?
Answer the question
In order to leave comments, you need to log in
MY_VAR="Hello world" node my-script.js
// my-script.js
console.log(process.env.MY_VAR) //Hello world
MY_VAR="Hello world" npx playwright test
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question