节点中的 .env 文件

2023-11-18

以下示例是关于Javascript中包含节点中的 .env 文件用法的示例代码,想了解节点中的 .env 文件的具体用法?节点中的 .env 文件怎么用?节点中的 .env 文件使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。

[英]:.env file in node源码类型:Javascript
Node latest .env file update

with the latest update in node version if you add this, then no requirement to 
add this line "require("dotenv").config();"

"script":{
   "dev": "node --env-file=.env index.js"
}

index.js
----
console.log(process.env.mySecrets);

本文地址:https://www.itbaoku.cn/snippets/876577.html