Environment variables containing newlines in Node?

后端 未结 8 466
再見小時候
再見小時候 2021-02-02 06:00

I\'m attempting to load an RSA private key into my nodejs application using environment variables, but the newlines seem to be being auto-escaped.

For the following, ass

8条回答
  •  情歌与酒
    2021-02-02 06:18

    dotenv supports newlines with double quotes:

    double quoted values expand new lines

    MULTILINE="new\nline" becomes

    {MULTILINE: 'new
    line'}
    

提交回复
热议问题