1.0.0 • Published 2 years ago

dotenv-dotnet-config v1.0.0

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
2 years ago

dotenv-dotnet-config

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

# install locally (recommended)
npm install dotenv-dotnet-config --save

Usage

Refer to dotenv documentation.

Contributing Guide

See CONTRIBUTING.md

CHANGELOG

See CHANGELOG.md