Can i store Objects in process.env

Short answer is: NO

No, you can’t store objects in process.env because it stores environment variables like PATH, SHELL, TMPDIR and others, which are represented by String values. If you run command console.log(process.env); you can see all env variables of your system, in particular you can set your own env variables (e.g. process.env.home="home") which will be available during the process you run your nodejs application.

Solution exists!
Stringify JSON object and save as env variable. Then parse and use it when you need your object

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)