A fork of Dotenv that supports specifying a colon (':') in the variable name. This allows .Net configuration binding to objects.
These .env file entries:
KeyOne=1
KeyTwo=true
KeyThree:Message= "Thanks for checking this out!"
are equivalent to the following appsettings.json:
{
"KeyOne": 1,
"KeyTwo": true,
"KeyThree": {
"Message": "Thanks for checking this out!"
}
}
// Get values from the config given their key and their target type.
int keyOneValue = config.GetValue<int>("KeyOne");
bool keyTwoValue = config.GetValue<bool>("KeyTwo");
string keyThreeNestedValue = config.GetValue<string>("KeyThree:Message");
# install locally (recommended)
npm install dotenv-dotnet-config --save
Refer to dotenv documentation.
See CONTRIBUTING.md
See CHANGELOG.md