{"id":24524192,"url":"https://github.com/bytedev/bytedev.configuration.environment","last_synced_at":"2025-07-24T07:35:24.921Z","repository":{"id":65505821,"uuid":"327274539","full_name":"ByteDev/ByteDev.Configuration.Environment","owner":"ByteDev","description":".NET Library to help when accessing environment variables.","archived":false,"fork":false,"pushed_at":"2022-11-28T08:45:16.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T22:05:58.973Z","etag":null,"topics":["configuration","csharp","dotnet-standard","environment","environment-variables"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ByteDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-06T10:19:12.000Z","updated_at":"2022-06-15T01:59:28.000Z","dependencies_parsed_at":"2023-01-26T13:30:23.720Z","dependency_job_id":null,"html_url":"https://github.com/ByteDev/ByteDev.Configuration.Environment","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ByteDev/ByteDev.Configuration.Environment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteDev%2FByteDev.Configuration.Environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteDev%2FByteDev.Configuration.Environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteDev%2FByteDev.Configuration.Environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteDev%2FByteDev.Configuration.Environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ByteDev","download_url":"https://codeload.github.com/ByteDev/ByteDev.Configuration.Environment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteDev%2FByteDev.Configuration.Environment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266808556,"owners_count":23987450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","csharp","dotnet-standard","environment","environment-variables"],"created_at":"2025-01-22T04:18:47.348Z","updated_at":"2025-07-24T07:35:24.889Z","avatar_url":"https://github.com/ByteDev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/github/bytedev/ByteDev.Configuration.Environment?branch=master\u0026svg=true)](https://ci.appveyor.com/project/bytedev/ByteDev-Configuration-Environment/branch/master)\n[![NuGet Package](https://img.shields.io/nuget/v/ByteDev.Configuration.Environment.svg)](https://www.nuget.org/packages/ByteDev.Configuration.Environment)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/ByteDev/ByteDev.Configuration.Environment/blob/master/LICENSE)\n\n# ByteDev.Configuration.Environment\n\nLibrary to help when accessing environment variables.\n\n## Installation\n\nByteDev.Configuration.Environment is hosted as a package on nuget.org.  To install from the Package Manager Console in Visual Studio run:\n\n`Install-Package ByteDev.Configuration.Environment`\n\nFurther details can be found on the [nuget page](https://www.nuget.org/packages/ByteDev.Configuration.Environment/).\n\n## Release Notes\n\nReleases follow semantic versioning.\n\nFull details of the release notes can be viewed on [GitHub](https://github.com/ByteDev/ByteDev.Configuration.Environment/blob/master/docs/RELEASE-NOTES.md).\n\n## Usage\n\nThe primary class for accessing environment variable is `EnvironmentVariableProvider` (`IEnvironmentVariableProvider`).\n\n`EnvironmentVariableProvider` has the following methods:\n- Delete\n- DeleteOrThrow\n- Exists\n- GetBoolean\n- GetBooleanOrDefault\n- GetByte\n- GetByteOrDefault\n- GetChar\n- GetCharOrDefault\n- GetDateTime\n- GetDateTimeOrDefault\n- GetDecimal\n- GetDecimalOrDefault\n- GetDouble\n- GetDoubleOrDefault\n- GetEnum\n- GetEnumOrDefault\n- GetGuid\n- GetInt16\n- GetInt16OrDefault\n- GetInt32\n- GetInt32OrDefault\n- GetInt64\n- GetInt64OrDefault\n- GetUri\n- GetSingle\n- GetSingleOrDefault\n- GetString\n- GetStringOrDefault\n- GetTimeSpan\n- GetTimeSpanOrDefault\n- Set\n\n```csharp\n// Initialize provider with an optional target level (Process by default)\n\nIEnvironmentVariableProvider provider = new EnvironmentVariableProvider(EnvironmentVariableTarget.User);\n```\n\n```csharp\n// Example string value\n\nprovider.Set(\"MyVar1\", \"Value1\");\n\nbool exists = provider.Exists(\"MyVar1\");    // exists == true\n\nstring s1 = provider.GetString(\"MyVar1\");   // s1 == \"Value1\"\n\nstring s2 = provider.GetString(\"MyVar2\");   // throws EnvironmentVariableNotExistException\n\nstring s3 = provider.GetStringOrDefault(\"MyVar1\");            // s3 == \"Value1\"\n\nstring s4 = provider.GetStringOrDefault(\"MyVar2\");            // s4 == null\n\nstring s5 = provider.GetStringOrDefault(\"MyVar2\", \"myValue\"); // s5 == \"myValue\"\n\nprovider.Delete(\"MyVar1\");\n\nprovider.Delete(\"MyVar2\");   // Does not throw exception when not exist\n```\n\n```csharp\n// Example URI value\n\nprovider.Set(\"MyUri1\", \"http://www.google.com/\");\nprovider.Set(\"MyUri2\", \"ThisIsNotUri\");\n\nUri uri0 = provider.GetUri(\"MyUri0\");   // throws EnvironmentVariableNotExistException\n\nUri uri1 = provider.GetUri(\"MyUri1\");   // uri1 == new Uri(\"http://www.google.com/\")\n\nUri uri2 = provider.GetUri(\"MyUri2\");   // throws UnexpectedEnvironmentVariableTypeException\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytedev%2Fbytedev.configuration.environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytedev%2Fbytedev.configuration.environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytedev%2Fbytedev.configuration.environment/lists"}