JSON
输入或粘贴 JSON
.env
转换结果
格式说明 ▾
JSON
{
"DB_HOST": "localhost",
"DB_PORT": 3306,
"DEBUG": true
}
.env
DB_HOST=localhost DB_PORT=3306 DEBUG=true
YAML
DB_HOST: localhost DB_PORT: 3306 DEBUG: true
转换规则
- JSON ↔ .env:对象键值对直接映射;嵌套对象值会被 JSON.stringify
- YAML ↔ .env:单行键值对转换;不支持多行值和嵌套结构
- .env 支持 # 注释行和空行(转换时会跳过)
- .env 值可以用单引号或双引号包裹,转换时自动去除