Your example looks more of an enumeration than a config array. I'd highly recommend using a model to save it.
In case you are referring to the above array just as an example and are more curious about how can arrays be stored in an env file -
Short answer:
You cannot.
Long answer:
.env variables are strings
So something like
BOOLEAN = true
will be treated as
BOOLEAN = "true"
and so will
FESTIVALS = ['bonnaroo', 'lollapalooza', 'coachella']
be treated as
FESTIVALS = "['bonnaroo', 'lollapalooza', 'coachella']"
Solution:
You can save the array as a delimited string in .env
FESTIVALS = "bonnaroo, lollapalooza, coachella"
In your js file you can convert it to an array using
var festivals = process.env.FESTIVALS.split(", ");
The result will be
['bonnaroo', 'lollapalooza', 'coachella']
split(", ")
. I missed it at first, and myincludes()
string matches failed =/ β Endoderm