1.0.1 • Published 5 years ago
json-props-filter v1.0.1
json-props-filter
Description
JSON property sometimes have too many properties. So this module provides filtering unnecessary data.
Requirement
You do not have to install when you would like to use this library. This module is written in pure JavaScript :).
Usage
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
Install
npm i json-props-filter
Licence
MIT