JsonMask.NET 1.1.0

dotnet add package JsonMask.NET --version 1.1.0
NuGet\Install-Package JsonMask.NET -Version 1.1.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="JsonMask.NET" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JsonMask.NET --version 1.1.0
#r "nuget: JsonMask.NET, 1.1.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.
// Install JsonMask.NET as a Cake Addin
#addin nuget:?package=JsonMask.NET&version=1.1.0

// Install JsonMask.NET as a Cake Tool
#tool nuget:?package=JsonMask.NET&version=1.1.0

JsonMask.NET

Build Status codecov

JsonMask.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.

Features

  • Lightweight and easy to integrate
  • Supports the same syntax as the original json-mask library
  • Available as a static utility or as a service for dependency injection

Getting Started

Prerequisites

  • .NET 6 or higher

Installation

Install JsonMask.NET via NuGet:

dotnet add package JsonMask.NET

Usage

Static Usage

var original = "{ \"a\": 1, \"b\": 1 }";
var mask = "a";
var result = Masker.Mask(original, mask);
Console.WriteLine(result); // Output: "{ \"a\": 1 }"

Using MaskerService

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 }"

Contributing

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 CONTRIBUTING.md file for detailed contribution guidelines.

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgments

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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 is compatible.  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. 
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 JsonMask.NET:

Package Downloads
JsonMask.NET.AspNetCore.Mvc.Controller.Filter

Mvc Controller filter to retrieve only requested json elements of a given resource. It uses JsonMask.NET.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 514 1/27/2024
1.0.0 85 1/24/2024