当前环境变量可通过Documentation Index
Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
Use this file to discover all available pages before exploring further.
process.env 或 Bun.env 访问。
在
.env 文件中设置这些变量。
Bun 会自动读取以下文件(按优先级递增顺序列出)。
.env.env.production、.env.development、.env.test(取决于NODE_ENV的值).env.local(当NODE_ENV=test时不会加载)
.env
变量也可以通过命令行设置。
有关在 Bun 中使用环境变量的更多信息,请参见 文档 > 运行时 > 环境变量。