magic.lambda.config 17.2.0

dotnet add package magic.lambda.config --version 17.2.0
                    
NuGet\Install-Package magic.lambda.config -Version 17.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="magic.lambda.config" Version="17.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="magic.lambda.config" Version="17.2.0" />
                    
Directory.Packages.props
<PackageReference Include="magic.lambda.config" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add magic.lambda.config --version 17.2.0
                    
#r "nuget: magic.lambda.config, 17.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package magic.lambda.config@17.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=magic.lambda.config&version=17.2.0
                    
Install as a Cake Addin
#tool nuget:?package=magic.lambda.config&version=17.2.0
                    
Install as a Cake Tool

magic.lambda.config - Accessing your server's configuration from Hyperlambda

This project provides configuration settings slots for Magic. The project provides the following slots, allowing you to retrieve configuration settings from your "appsettings.json" configuration file, in addition to saving and loading your configuration file.

  • [config.get] - Returns a configuration value from your configuration file with the specified key
  • [config.section] - Returns the specified configuration section from your configuration file with the specified key
  • [config.load] - Loads your "appsettings.json" file and returns as a string
  • [config.save] - Saves your "appsettings.json" file, sanity checking it's valid JSON before persisting your file

How to use [config.get]

This slot allows you to retrieve configuration settings. To retrieve settings you can supply a "path" such as "foo:bar" to for instance an invocation to [config.get]. This will traverse into your "foo" config setting, find its "bar" key, and return the value of your "bar" key. Below is an example of usage.

config.get:"foo:bar"

Assuming your configuration file looks like the following.

{
   "foo": {
      "bar": 42
   }
}

... afterwards the value of your [config.get] node will be the following.

config.get:42

Notice - Due to implementation details of .Net and its IConfiguration specifically, values returned will always be strings, and you'll have to manually convert these to other types, using for instance the [convert] slot from magic.lambda. This might change in a future release though. You can also provide a default value that will be returned if no configuration value is found, such as the following illustrates.

.foo:foo
config.get:"magic:foo:non-existing-key"
   get-value:x:@.foo

Since the above "non-existing-key" doesn't exist in your configuration file, the above Hyperlambda will return the value "foo" being the result of the invocation to the [get-value] slot. This allows you to create default values your code resorts to if the specified configuration setting doesn't exist.

Magic's GitHub project page

Magic is 100% Open Source and you can find the primary project GitHub page here.

Project website for magic.lambda.config

The source code for this repository can be found at github.com/polterguy/magic.lambda.config, and you can provide feedback, provide bug reports, etc at the same place.

  • Build status
  • Quality Gate Status
  • Bugs
  • Code Smells
  • Coverage
  • Duplicated Lines (%)
  • Lines of Code
  • Maintainability Rating
  • Reliability Rating
  • Security Rating
  • Technical Debt
  • Vulnerabilities

The projects is copyright Thomas Hansen 2023 - 2024, and professionally maintained by AINIRO.IO.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on magic.lambda.config:

Package Downloads
magic.library

Helper project for Magic to wire up everything easily by simply adding one package, and invoking two simple methods. When using Magic, this is (probably) the only package you should actually add, since this package pulls in everything else you'll need automatically, and wires up everything sanely by default. To use package go to https://polterguy.github.io

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
17.2.0 1,723 1/22/2024
17.1.7 341 1/12/2024
17.1.6 303 1/11/2024
17.1.5 336 1/5/2024
17.0.1 406 1/1/2024
17.0.0 546 12/14/2023
16.11.5 462 11/12/2023
16.9.0 407 10/9/2023
16.7.0 729 7/11/2023
16.4.1 561 7/2/2023
16.4.0 574 6/22/2023
16.3.1 460 6/7/2023
16.3.0 462 5/28/2023
16.1.9 772 4/30/2023
15.10.11 579 4/13/2023
15.9.1 740 3/27/2023
15.9.0 619 3/24/2023
15.8.2 633 3/20/2023
15.7.0 511 3/6/2023
15.5.0 1,754 1/28/2023
15.2.0 778 1/18/2023
15.1.0 1,312 12/28/2022
14.5.7 839 12/13/2022
14.5.5 957 12/6/2022
14.5.1 786 11/23/2022
14.5.0 740 11/18/2022
14.4.5 826 10/22/2022
14.4.1 886 10/22/2022
14.4.0 796 10/17/2022
14.3.1 1,397 9/12/2022
14.3.0 811 9/10/2022
14.1.3 1,053 8/7/2022
14.1.2 793 8/7/2022
14.1.1 801 8/7/2022
14.0.14 820 7/26/2022
14.0.12 797 7/24/2022
14.0.11 762 7/23/2022
14.0.10 787 7/23/2022
14.0.9 804 7/23/2022
14.0.8 853 7/17/2022
14.0.5 932 7/11/2022
14.0.4 917 7/6/2022
14.0.3 827 7/2/2022
14.0.2 810 7/2/2022
14.0.0 1,046 6/25/2022
13.4.0 2,349 5/31/2022
13.3.4 1,597 5/9/2022
13.3.0 1,138 5/1/2022
13.2.2 885 4/25/2022
13.2.0 1,095 4/21/2022
13.1.0 1,193 4/7/2022
13.0.0 885 4/5/2022
11.0.5 1,600 3/2/2022
11.0.4 953 2/22/2022
11.0.3 934 2/9/2022
11.0.2 1,008 2/6/2022
11.0.1 936 2/5/2022
10.0.21 923 1/28/2022
10.0.20 894 1/27/2022
10.0.19 915 1/23/2022
10.0.18 901 1/17/2022
10.0.16 867 1/14/2022
10.0.15 870 12/31/2021
10.0.14 726 12/28/2021
10.0.7 1,695 12/22/2021
10.0.5 919 12/18/2021
9.9.9 1,847 11/29/2021
9.9.3 1,106 11/9/2021
9.9.2 817 11/4/2021
9.9.0 892 10/30/2021
9.8.9 844 10/29/2021
9.8.7 815 10/27/2021
9.8.6 781 10/27/2021
9.8.5 775 10/26/2021
9.8.0 1,553 10/20/2021
9.7.9 803 10/19/2021
9.7.5 1,708 10/14/2021
9.7.0 1,023 10/9/2021
9.6.6 1,393 8/14/2021
9.2.0 6,749 5/26/2021
9.1.4 1,446 4/21/2021
9.1.0 1,254 4/14/2021
9.0.0 1,021 4/5/2021
8.9.9 1,151 3/30/2021
8.9.3 1,747 3/19/2021
8.9.2 1,215 1/29/2021
8.9.1 1,178 1/24/2021
8.9.0 1,267 1/22/2021
8.6.9 3,211 11/8/2020
8.6.6 2,199 11/2/2020
8.6.0 4,188 10/28/2020
8.5.0 2,122 10/23/2020
8.4.0 5,882 10/13/2020
8.3.1 2,833 10/5/2020
8.3.0 1,406 10/3/2020
8.2.2 2,225 9/26/2020
8.2.1 1,474 9/25/2020
8.2.0 1,554 9/25/2020
8.1.17 6,935 9/13/2020
8.1.16 752 9/13/2020
8.1.15 2,056 9/12/2020
8.1.11 2,729 9/11/2020
8.1.10 1,483 9/6/2020
8.1.9 1,515 9/3/2020
8.1.8 1,487 9/2/2020
8.1.7 1,401 8/28/2020
8.1.4 1,383 8/25/2020
8.1.3 1,463 8/18/2020
8.1.2 1,415 8/16/2020
8.1.1 1,472 8/15/2020
8.1.0 781 8/15/2020
8.0.1 2,921 8/7/2020
8.0.0 1,413 8/7/2020
7.0.1 1,508 6/28/2020
7.0.0 1,428 6/28/2020
5.0.0 7,713 2/25/2020
4.0.4 8,134 1/27/2020
4.0.3 1,459 1/27/2020
4.0.2 1,560 1/16/2020
4.0.1 1,554 1/11/2020
4.0.0 1,553 1/5/2020
3.1.0 6,572 11/10/2019
3.0.0 4,126 10/23/2019
2.0.1 8,671 10/15/2019
2.0.0 1,865 10/13/2019
1.1.8 1,543 10/11/2019
1.1.7 1,476 10/10/2019
1.1.6 758 10/9/2019
1.1.5 776 10/6/2019
1.1.4 818 10/6/2019
1.1.2 777 10/5/2019
1.0.0 856 9/26/2019