JSON property sometimes have too many properties. So this module provides filtering unnecessary data.
You do not have to install when you would like to use this library. This module is written in pure JavaScript :).
const data = { foo: "bar", bar: "baz" };
// remove foo property data
const result = jsonPropsFilter(data1, "foo");
// then you can get filtered data => {bar: "baz" };
// also you can remove the data from array at once
const data2 = { foo: "bar", bar: "baz", baz: "bug" };
const result3 = jsonPropsFilter(data2, ["foo", "bar"]);
// you can get filtered data => {baz: "bug" };
Please check the example codes in the repository.
- example/basic_usage.js
npm i json-props-filter
MIT