Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get environment variable

const variableValue = process.env.VARIABLE_NAME;

//Good practice is to include a default value in case the variable is not found:
const dbPassword = process.env.DB_PASSWORD || "";
 
PREVIOUS NEXT
Tagged: #js #environment #variable
ADD COMMENT
Topic
Name
9+4 =