This is a tiny language and an engine for selecting specific parts of a Json object, hiding/masking the rest.
$ dotnet add package JsonMask.NETJsonMask.NET is a simple .NET port of the popular JavaScript library json-mask, designed to allow selective filtering of JSON data using a concise syntax. This library is perfect for reducing payloads in APIs, extracting specific parts from JSON, and more, with compatibility across all .NET applications.
Install JsonMask.NET via NuGet:
dotnet add package JsonMask.NET
var original = "{ \"a\": 1, \"b\": 1 }";
var mask = "a";
var result = Masker.Mask(original, mask);
Console.WriteLine(result); // Output: "{ \"a\": 1 }"
IMaskerService maskerService = new MaskerService();
var original = "{ \"a\": 1, \"b\": 1 }";
var mask = "a";
var result = maskerService.Mask(original, mask);
Console.WriteLine(result); // Output: "{ \"a\": 1 }"
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. Please refer to the file for detailed contribution guidelines.
Distributed under the MIT License. See LICENSE for more information.