Neuroglia.Data.Expressions.JavaScript
4.16.2
Prefix Reserved
dotnet add package Neuroglia.Data.Expressions.JavaScript --version 4.16.2
NuGet\Install-Package Neuroglia.Data.Expressions.JavaScript -Version 4.16.2
<PackageReference Include="Neuroglia.Data.Expressions.JavaScript" Version="4.16.2" />
paket add Neuroglia.Data.Expressions.JavaScript --version 4.16.2
#r "nuget: Neuroglia.Data.Expressions.JavaScript, 4.16.2"
// Install Neuroglia.Data.Expressions.JavaScript as a Cake Addin #addin nuget:?package=Neuroglia.Data.Expressions.JavaScript&version=4.16.2 // Install Neuroglia.Data.Expressions.JavaScript as a Cake Tool #tool nuget:?package=Neuroglia.Data.Expressions.JavaScript&version=4.16.2
Neuroglia.Data.Expressions.JavaScript
A .NET package to evaluate expressions using JavaScript
. This library integrates JavaScript
with .NET applications, making it simple to work with JSON data transformations and expressions.
Getting Started
Installation
Add the package to your .NET project:
dotnet add package Neuroglia.Data.Expressions.JavaScript
Configuration
Optionally, configure the JQ Expression Evaluator in your application's Dependency Injection (DI) container:
services.AddJavaScriptExpressionEvaluator(options =>
{
options.UseSerializer<MyJsonSerializerImplementation>(); // Optional: Defaults to the first registered `IJsonSerializer`
}, ServiceLifetime.Singleton);
Usage
After setup, you can start using the evaluator to process expressions.
Example Code
var defaultEvaluator = serviceProvider.GetRequiredService<IExpressionEvaluator>();
var explicitEvaluator = serviceProvider.GetRequiredService<IExpressionEvaluatorProvider>().GetEvaluator("js");
var expression = "{ \"foo\": .foo, \"bar\": $param1.bar }";
var input = new
{
foo = "bar"
};
var arguments = new Dictionary<string, object>()
{
{
"param1",
new
{
bar = "baz"
}
}
};
var result = await defaultEvaluator.EvaluateAsync(expression, input, arguments, typeof(MyResult));
public class MyResult
{
public string Foo { get; set; }
public string Bar { get; set; }
}
Features
- Easily integrate
JavaScript
with .NET applications. - Support for Dependency Injection with customizable options.
- Strongly-typed evaluation for JSON transformation.
- Flexible serialization options.
Requirements
- .NET Version: Compatible with .NET 9+.
Contributing
Feel free to contribute to this project! Please submit issues, feature requests, or pull requests on the GitHub repository.
License
This project is licensed under the Apache 2.0
license.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
-
net9.0
- Jint (>= 4.1.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Neuroglia.Data.Expressions.Abstractions (>= 4.16.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Neuroglia.Data.Expressions.JavaScript:
Repository | Stars |
---|---|
serverlessworkflow/synapse
Serverless Workflow Management System (WFMS)
|
Version | Downloads | Last updated |
---|---|---|
4.16.2 | 83 | 11/20/2024 |
4.16.1 | 77 | 11/18/2024 |
4.16.0 | 89 | 11/14/2024 |
4.15.9 | 73 | 11/14/2024 |
4.15.8 | 507 | 10/11/2024 |
4.15.7 | 90 | 10/9/2024 |
4.15.6 | 369 | 9/10/2024 |
4.15.5 | 84 | 9/10/2024 |
4.15.4 | 218 | 9/8/2024 |
4.15.3 | 184 | 9/2/2024 |
4.15.2 | 104 | 8/30/2024 |
4.15.1 | 95 | 8/26/2024 |
4.15.0 | 139 | 8/26/2024 |
4.14.1 | 136 | 8/21/2024 |
4.14.0 | 136 | 8/16/2024 |
4.13.0 | 113 | 8/16/2024 |
4.12.10 | 117 | 8/14/2024 |
4.12.9 | 130 | 8/14/2024 |
4.12.8 | 118 | 8/12/2024 |
4.12.7 | 116 | 8/8/2024 |
4.12.6 | 70 | 7/25/2024 |
4.12.5 | 107 | 7/9/2024 |
4.12.4 | 87 | 7/9/2024 |
4.12.3 | 94 | 7/8/2024 |
4.12.2 | 127 | 6/26/2024 |
4.12.1 | 142 | 6/18/2024 |
4.12.0 | 85 | 6/17/2024 |
4.11.3 | 102 | 6/13/2024 |
4.11.2 | 85 | 6/12/2024 |
4.11.1 | 102 | 6/7/2024 |
4.11.0 | 116 | 5/31/2024 |
4.10.0 | 119 | 5/30/2024 |
4.9.15 | 109 | 5/20/2024 |
4.9.14 | 98 | 5/15/2024 |
4.9.13 | 88 | 5/12/2024 |
4.9.12 | 70 | 5/11/2024 |
4.9.11 | 81 | 5/8/2024 |
4.9.10 | 87 | 5/7/2024 |
4.9.9 | 113 | 5/6/2024 |
4.9.8 | 101 | 5/6/2024 |
4.9.7 | 56 | 5/2/2024 |
4.9.6 | 108 | 4/15/2024 |
4.9.5 | 93 | 4/10/2024 |
4.9.4 | 79 | 4/10/2024 |
4.9.3 | 83 | 4/10/2024 |
4.9.2 | 86 | 4/10/2024 |
4.9.1 | 99 | 4/10/2024 |
4.9.0 | 105 | 4/9/2024 |
4.8.5 | 112 | 4/4/2024 |
4.8.4 | 111 | 4/3/2024 |
4.8.3 | 113 | 3/25/2024 |
4.8.2 | 102 | 3/22/2024 |
4.8.1 | 125 | 3/18/2024 |
4.8.0 | 121 | 3/18/2024 |
4.7.7 | 203 | 12/8/2023 |
4.7.6 | 150 | 12/6/2023 |
4.7.5 | 143 | 12/5/2023 |
4.7.4 | 143 | 12/5/2023 |
4.7.3 | 146 | 12/4/2023 |
4.7.2 | 161 | 12/4/2023 |
4.7.1 | 127 | 12/1/2023 |
4.7.0 | 143 | 11/28/2023 |
4.6.1 | 156 | 11/27/2023 |
4.6.0 | 154 | 11/25/2023 |
4.5.2 | 152 | 11/25/2023 |
4.5.1 | 155 | 11/23/2023 |
4.5.0 | 156 | 11/23/2023 |
4.4.2 | 141 | 11/22/2023 |
4.4.1 | 128 | 11/21/2023 |
4.4.0 | 154 | 11/21/2023 |
4.3.3 | 134 | 11/20/2023 |
4.3.2 | 139 | 11/20/2023 |
4.3.1 | 147 | 11/20/2023 |
4.3.0 | 126 | 11/20/2023 |
4.2.1 | 152 | 11/17/2023 |
4.2.0 | 143 | 11/17/2023 |
4.1.0 | 130 | 11/17/2023 |
4.0.0 | 148 | 11/15/2023 |
3.10.0 | 131 | 11/15/2023 |
3.9.0 | 139 | 11/15/2023 |
3.8.4 | 148 | 11/10/2023 |
3.8.3 | 125 | 11/10/2023 |
3.8.2 | 111 | 11/10/2023 |
3.8.1 | 154 | 11/10/2023 |
3.8.0 | 142 | 11/9/2023 |
3.7.0 | 148 | 11/8/2023 |
3.6.1 | 143 | 11/8/2023 |
3.6.0 | 146 | 11/7/2023 |
3.5.2 | 143 | 11/6/2023 |
3.5.1 | 135 | 11/3/2023 |
3.5.0 | 135 | 11/3/2023 |
3.4.0 | 155 | 10/25/2023 |
3.3.0 | 166 | 10/23/2023 |
3.2.0 | 165 | 10/19/2023 |
3.1.1 | 157 | 10/18/2023 |
3.1.0 | 140 | 10/18/2023 |
3.0.1 | 162 | 10/16/2023 |
2.1.4 | 181 | 7/14/2023 |
2.1.3 | 190 | 6/22/2023 |
2.1.2 | 178 | 5/31/2023 |
2.1.1 | 161 | 5/25/2023 |
2.1.0 | 213 | 4/4/2023 |