Elysia Tools
Navegação
Formatos de dados
Exemplos de variáveis de ambiente
Exemplos de variáveis de ambiente cobrem aspas, valores vazios e nomes no dotenv Node.js.
Exemplos
Entradas desta coleção
Cerquilha entre aspas e valores de texto
A cerquilha entre aspas é dado, não o comentário externo. O indicador continua texto.
Etiquetas
synthetic, offline, text-operations
{
"fixture_kind": "synthetic-invalid-placeholders",
"input": "APP_LABEL=\"demo # blue\" # outside comment\nFEATURE_FLAG=false\n",
"operation": "Read using the Node.js dotenv specification; do not load into the process environment.",
"expected": {
"APP_LABEL": "demo # blue",
"FEATURE_FLAG": "false"
}
}Vazio versus ausente
Uma declaração vazia mantém a chave; ausência não é string vazia. Variáveis herdadas ficam fora.
Etiquetas
synthetic, offline, text-operations
{
"fixture_kind": "synthetic-invalid-placeholders",
"input": "EMPTY=\"\"\nMODE=demo\n",
"operation": "Inspect only this fixture: compare EMPTY with undeclared MISSING.",
"expected": {
"EMPTY": {
"declared": true,
"value": ""
},
"MISSING": {
"declared": false
}
}
}Diagnóstico de nomes de variáveis
Sublinhado é permitido, hífen e espaço não; apenas esta regra do Node.js.
Etiquetas
synthetic, offline, text-operations
{
"fixture_kind": "synthetic-invalid-placeholders",
"input": [
"APP_MODE",
"_DEMO",
"DEMO-MODE",
"DEMO MODE"
],
"operation": "Classify names using ^[a-zA-Z_]+[a-zA-Z0-9_]*$; this is a diagnostic list, not a dotenv file.",
"expected": [
true,
true,
false,
false
]
}Ferramentas
Ferramentas frequentemente usadas com este exemplo
Relacionado
Coleções de exemplos relacionadas
Relacionado